public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		in.nextLine();
		boolean[][][] space = new boolean[N][N][N];
		for (int i = 0; i < N; i++)
			for (int j = 0; j < N; j++)
			{
				String nextLine = in.nextLine();
				for (int k = 0; k < N; k++)
					if (nextLine.charAt(k) == '*')
						space[i][j][k] = true;
			}
		
		Space smartSpace = new Space(space);
		int asteroidCount = 0;
		for (int i = 0; i < N; i++)
			for (int j = 0; j < N; j++)
				for (int k = 0; k < N; k++)
					if (smartSpace.space[i][j][k])
					{
						asteroidCount++;
						smartSpace.floodFill(i, j, k);
					}
		System.out.println(asteroidCount);
	}