#include <bits/stdc++.h>
using namespace std;
struct E_Node {
  int v, ne;
} E[3000 << 3];
int R[3000];
int G[20][20][20], O[20][20][20];
int Q[3000];
bool B[3000];
int N, K, M, now, sz, h, t, x, y;
void Add(int a, int b) {
  if (!b) return;
  E[++sz].v = b;
  E[sz].ne = R[a];
  R[a] = sz;
  E[++sz].v = a;
  E[sz].ne = R[b];
  R[b] = sz;
}
int main() {
  scanf("%d%d%d\n", &K, &N, &M);
  now = 0;
  for (int i = 1; i <= K; i++) {
    for (int j = 1; j <= N; j++) {
      for (int k = 1; k <= M; k++) G[i][j][k] = getchar(), O[i][j][k] = ++now;
      getchar();
    }
    getchar();
  }
  for (int i = 1; i <= K; i++)
    for (int j = 1; j <= N; j++)
      for (int k = 1; k <= M; k++)
        if (G[i][j][k] == '.') {
          if (G[i + 1][j][k] == '.') Add(O[i][j][k], O[i + 1][j][k]);
          if (G[i - 1][j][k] == '.') Add(O[i][j][k], O[i - 1][j][k]);
          if (G[i][j + 1][k] == '.') Add(O[i][j][k], O[i][j + 1][k]);
          if (G[i][j - 1][k] == '.') Add(O[i][j][k], O[i][j - 1][k]);
          if (G[i][j][k + 1] == '.') Add(O[i][j][k], O[i][j][k + 1]);
          if (G[i][j][k - 1] == '.') Add(O[i][j][k], O[i][j][k - 1]);
        }
  scanf("%d%d", &x, &y);
  Q[h = t = 1] = O[1][x][y];
  memset(B, 0, sizeof B);
  B[Q[1]] = 1;
  for (; h <= t; h++) {
    for (int p = R[Q[h]]; p; p = E[p].ne)
      if (!B[E[p].v]) {
        B[E[p].v] = 1;
        Q[++t] = E[p].v;
      }
  }
  printf("%d\n", t);
}
