#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000;
const double pi = acos(-1.0);
int dad[1500];
int sz[1500];
int number[12][12][12];
int dsu_find(int x) {
  while (dad[x] != x) {
    dad[x] = dad[dad[x]];
    x = dad[x];
  }
  return x;
}
void dsu_union(int x, int y) {
  int xx = dsu_find(x);
  int yy = dsu_find(y);
  if (xx < yy)
    dad[yy] = xx;
  else
    dad[xx] = yy;
}
int dx[] = {0, 0, 0, 0, 1, -1};
int dy[] = {0, 0, 1, -1, 0, 0};
int dz[] = {1, -1, 0, 0, 0, 0};
int main() {
  std::ios_base::sync_with_stdio(false);
  int k, n, m;
  while (cin >> k >> n >> m) {
    string s[10][10];
    for (int i = 0; i < k; i++)
      for (int j = 0; j < n; j++) cin >> s[i][j];
    memset(dad, (-1), sizeof(dad));
    memset(number, 0, sizeof(number));
    fill(sz, sz + 1500, 1);
    int ctr = 0;
    for (int i = 0; i < k; i++)
      for (int j = 0; j < n; j++)
        for (int l = 0; l < m; l++) {
          if (s[i][j][l] == '.') {
            dad[ctr] = ctr;
            number[i][j][l] = ctr;
            ctr++;
          }
        }
    for (int i = 0; i < k; i++)
      for (int j = 0; j < n; j++)
        for (int l = 0; l < m; l++) {
          if (s[i][j][l] == '.') {
            for (int p = 0; p < 6; p++) {
              int nx = j + dx[p];
              int ny = l + dy[p];
              int nz = i + dz[p];
              if (nx >= 0 && ny >= 0 && nz >= 0 && nx < n && ny < m && nz < k) {
                if (s[nz][nx][ny] == '.') {
                  if (dsu_find(number[i][j][l]) != dsu_find(number[nz][nx][ny]))
                    dsu_union(number[i][j][l], number[nz][nx][ny]);
                }
              }
            }
          }
        }
    int x, y;
    cin >> x >> y;
    x--, y--;
    int pa = dsu_find(number[0][x][y]);
    int ans = 0;
    for (int i = 0; i < k; i++)
      for (int j = 0; j < n; j++)
        for (int l = 0; l < m; l++) {
          if (s[i][j][l] == '.')
            if (dsu_find(number[i][j][l]) == pa) ans++;
        }
    cout << ans << endl;
  }
  return 0;
}
