#include <bits/stdc++.h>
using namespace std;
int range[6][3] = {{-1, 0, 0}, {0, 0, 1},  {0, 1, 0},
                   {0, -1, 0}, {0, 0, -1}, {1, 0, 0}};
char grid[20][20][20];
int k, n, m, qnt, usadas, tempo;
struct state {
  int i, j, k;
  state() {}
  state(int i, int j, int k) : i(i), j(j), k(k) {}
} atual;
queue<state> fila;
void bfs(int inii, int inij) {
  fila.push(state(inii, inij, 0));
  tempo = 0;
  int ii, jj, kk;
  usadas = 1;
  grid[0][inii][inij] = '#';
  while (!fila.empty()) {
    atual = fila.front();
    fila.pop();
    for (int a = 0; a < 6; a++) {
      kk = range[a][0] + atual.k;
      ii = range[a][1] + atual.i;
      jj = range[a][2] + atual.j;
      if (kk >= 0 && kk < k && ii >= 0 && ii < n && jj >= 0 && jj < m &&
          grid[kk][ii][jj] == '.') {
        ++usadas;
        grid[kk][ii][jj] = '#';
        fila.push(state(ii, jj, kk));
      }
    }
  }
}
int main() {
  scanf("%d%d%d", &k, &n, &m);
  qnt = 0;
  tempo = 0;
  usadas = 0;
  for (int kk = 0; kk < k; kk++) {
    for (int ii = 0; ii < n; ii++) {
      scanf("%s", grid[kk][ii]);
      for (int jj = 0; jj < m; ++jj) {
        if (grid[kk][ii][jj] == '.') ++qnt;
      }
    }
  }
  int inii, inij;
  scanf("%d%d", &inii, &inij);
  bfs(inii - 1, inij - 1);
  printf("%d\n", usadas);
  return 0;
}
