#include <bits/stdc++.h>
using namespace std;
const int dz[] = {0, 0, 0, 0, -1, 1}, dx[] = {-1, 0, 1, 0, 0, 0},
          dy[] = {0, -1, 0, 1, 0, 0};
int k, n, m;
char plate[10][10][10];
bool seen[10][10][10];
int dfs(int x, int y, int z) {
  int ret = 1;
  seen[z][x][y] = true;
  for (int i = 0; i < (int)(6); i++) {
    int az = z + dz[i], ax = x + dx[i], ay = y + dy[i];
    if (az < 0 || k <= az || ax < 0 || n <= ax || ay < 0 || m <= ay) continue;
    if (plate[az][ax][ay] == '#' || seen[az][ax][ay]) continue;
    ret += dfs(ax, ay, az);
  }
  return ret;
}
int main() {
  while (cin >> k >> n >> m) {
    for (int i = 0; i < (int)(k); i++)
      for (int j = 0; j < (int)(n); j++)
        for (int l = 0; l < (int)(m); l++) cin >> plate[i][j][l];
    int x, y;
    cin >> x >> y;
    memset(seen, 0, sizeof(seen));
    cout << dfs(x - 1, y - 1, 0) << endl;
  }
  return 0;
}
