#include <bits/stdc++.h>
using namespace std;
char arr[110][110][110];
int dx[] = {0, 0, 1, -1, 0, 0};
int dy[] = {1, -1, 0, 0, 0, 0};
int dz[] = {0, 0, 0, 0, 1, -1};
int vis[110][110][110];
int k, n, m;
bool inBox(int z, int i, int j) {
  return z >= 0 && z < k && i >= 0 && i < n && j >= 0 && j < m &&
         arr[z][i][j] == '.';
}
int ans = 0;
void solve(int z, int i, int j) {
  vis[z][i][j] = 1;
  ans++;
  for (int rr = (0); rr < (int)(6); ++rr) {
    int nz = z + dz[rr];
    int ni = i + dx[rr];
    int nj = j + dy[rr];
    if (inBox(nz, ni, nj) && vis[nz][ni][nj] == 0) {
      solve(nz, ni, nj);
    }
  }
}
int main() {
  scanf("%d", &k), scanf("%d", &n), scanf("%d", &m);
  for (int i = (0); i < (int)(k); ++i) {
    for (int r = (0); r < (int)(n); ++r) {
      scanf("%s", arr[i][r]);
    }
  }
  int xx, yy;
  scanf("%d", &xx), scanf("%d", &yy);
  solve(0, xx - 1, yy - 1);
  printf("%d", ans);
  return 0;
}
