public int countOpenChains()
	{
		int chainCount = 0;
		
		for(int i = 0; i < height; i++)
		{
			for(int j = 0; j < width; j++)
			{
				int vertex = j + i * width;
				List<List<Integer>> chains = getAllChains(vertex);
				for(int chainIndex = 0; chainIndex < chains.size(); chainIndex++)
				{
					if(chains.get(chainIndex).size() >= 3)
					{
						chainCount++;
					}
				}
			}
		}
		clearGraphMarks();
		return chainCount;
	}