#include <bits/stdc++.h>
using namespace std;
char arr[12][12][12];
void Water(int z, int x, int y) {
  arr[z][x][y] = '*';
  if (arr[z][x + 1][y] == '.') Water(z, x + 1, y);
  if (arr[z][x - 1][y] == '.') Water(z, x - 1, y);
  if (arr[z + 1][x][y] == '.') Water(z + 1, x, y);
  if (arr[z - 1][x][y] == '.') Water(z - 1, x, y);
  if (arr[z][x][y + 1] == '.') Water(z, x, y + 1);
  if (arr[z][x][y - 1] == '.') Water(z, x, y - 1);
}
int main() {
  int k, n, m;
  cin >> k >> n >> m;
  for (int t = 1; t <= k; t++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) cin >> arr[t][i][j];
  int x, y;
  cin >> x >> y;
  Water(1, x, y);
  int res = 0;
  for (int t = 1; t <= k; t++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++)
        if (arr[t][i][j] == '*') res++;
  cout << res;
  return 0;
}
