#include <bits/stdc++.h>
using namespace std;
int mapa[11][11][11];
int dist[11][11][11];
int vx[6] = {0, 0, 0, 0, -1, 1};
int vy[6] = {0, 0, -1, 1, 0, 0};
int vz[6] = {-1, 1, 0, 0, 0, 0};
struct triple {
  int x;
  int y;
  int z;
  triple() { x = y = z = 0; }
  triple(int a, int b, int c) {
    x = a;
    y = b;
    z = c;
  }
};
int k, n, m;
bool valid(triple t) {
  if (t.x > 0 && t.x <= n && t.y > 0 && t.y <= m && t.z > 0 && t.z <= k &&
      mapa[t.x][t.y][t.z] != 1 && dist[t.x][t.y][t.z] == -1)
    return 1;
  return 0;
}
void bfs(triple ini) {
  queue<triple> fila;
  dist[ini.x][ini.y][ini.z] = 1;
  fila.push(ini);
  while (!fila.empty()) {
    triple at = fila.front();
    fila.pop();
    triple nx;
    for (int i = 0; i < 6; i++) {
      nx.x = at.x + vx[i];
      nx.y = at.y + vy[i];
      nx.z = at.z + vz[i];
      if (valid(nx)) {
        dist[nx.x][nx.y][nx.z] = dist[at.x][at.y][at.z] + 1;
        fila.push(nx);
      }
    }
  }
}
int main() {
  scanf("%d %d %d", &k, &n, &m);
  memset(dist, -1, sizeof(dist));
  for (int q = 1; q <= k; q++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) {
        char c;
        scanf(" %c", &c);
        mapa[i][j][q] = (c == '#');
      }
  int x0, y0;
  scanf("%d %d", &x0, &y0);
  bfs(triple(x0, y0, 1));
  int mx = 0;
  for (int q = 1; q <= k; q++)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) mx += (dist[i][j][q] != -1);
  printf("%d\n", mx);
}
