#include <bits/stdc++.h>
using namespace std;
int k, n, m;
bool cubo[12][12][12];
int mov[6][3] = {{0, 1, 0},  {0, 0, 1}, {0, -1, 0},
                 {0, 0, -1}, {1, 0, 0}, {-1, 0, 0}};
int cont;
void llena(int za, int xa, int ya) {
  cubo[za][xa][ya] = false;
  int z, x, y;
  for (int i = 0; i < 6; i++) {
    z = za + mov[i][0];
    x = xa + mov[i][1];
    y = ya + mov[i][2];
    if (cubo[z][x][y]) {
      cont++;
      llena(z, x, y);
    }
  }
}
int main() {
  scanf("%d %d %d", &k, &n, &m);
  char cad[12];
  scanf("\n");
  int i, j, g, h;
  for (g = 1; g <= k; g++) {
    for (i = 1; i <= n; i++) {
      scanf("%s", cad);
      for (j = 0; j < m; j++) {
        if (cad[j] == '.') cubo[g][i][j + 1] = true;
      }
    }
    scanf("\n");
  }
  int x, y;
  scanf("%d %d", &x, &y);
  cont = 1;
  llena(1, x, y);
  cout << cont;
  return 0;
}
