#include <bits/stdc++.h>
const int maxn = 1e8 + 5;
using namespace std;
int k, n, m, x, y;
char a[15][15][15];
int cnt;
int ans, num;
void check(int cen, int x, int y) {
  a[cen][x][y] = '#';
  ans++;
  int ncen[6] = {1, 0, 0, -1, 0, 0};
  int nx[6] = {0, 1, 0, 0, -1, 0};
  int ny[6] = {0, 0, 1, 0, 0, -1};
  for (int i = 0; i <= 5; i++) {
    int ccen = cen + ncen[i], cx = x + nx[i], cy = y + ny[i];
    if (a[ccen][cx][cy] == '.' && ccen > 0 && ccen <= k && cx > 0 && cx <= n &&
        cy > 0 && cy <= m) {
      check(ccen, cx, cy);
    }
  }
}
int main() {
  scanf("%d %d %d", &k, &n, &m);
  getchar();
  for (int i = 1; i <= k; i++) {
    getchar();
    for (int j = 1; j <= n; j++) {
      for (int h = 1; h <= m; h++) {
        scanf("%c", &a[i][j][h]);
      }
      getchar();
    }
  }
  scanf("%d %d", &x, &y);
  check(1, x, y);
  printf("%d\n", ans);
  return 0;
}
