#include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, -1, 0, 0, 0, 0};
const int dy[] = {0, 0, 1, -1, 0, 0};
const int dz[] = {0, 0, 0, 0, 1, -1};
int a[12][12][12], b[12][12][12];
char ss[1000];
int q[1 << 20];
int main() {
  int k, n, m;
  scanf("%d%d%d\n\n", &k, &n, &m);
  memset(b, 1, sizeof b);
  for (int kk = 1; kk <= k; kk++) {
    for (int i = 1; i <= n; i++) {
      gets(ss);
      for (int j = 1; j <= m; j++) {
        a[kk][i][j] = ss[j - 1] == '#';
        b[kk][i][j] = 0;
      }
    }
    scanf("\n");
  }
  int sx, sy;
  scanf("%d%d", &sx, &sy);
  int qb = 0, qe = 0;
  q[qe++] = (1 << 8) + (sx << 4) + (sy << 0);
  b[1][sx][sy] = 1;
  while (qb < qe) {
    int v = q[qb++];
    int x = v >> 8, y = (v >> 4) & 15, z = v & 15;
    for (int d = 0; d < (6); d++) {
      int xx = x + dx[d], yy = y + dy[d], zz = z + dz[d];
      if (!b[xx][yy][zz] && !a[xx][yy][zz]) {
        b[xx][yy][zz] = 1;
        q[qe++] = (xx << 8) + (yy << 4) + zz;
      }
    }
  }
  printf("%d\n", qe);
  return 0;
}
