#include <bits/stdc++.h>
using namespace std;
bool ok[11][11][11];
bool v[11][11];
char mp[11][11][11];
int m, n;
int d[][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
bool is_ok;
struct N {
  int x, y;
  void init(int xx, int yy) {
    x = xx;
    y = yy;
  }
} node[11 * 11 * 2];
bool legal(int x, int y, int k) {
  if (x >= 0 && y >= 0 && x < n && y < m)
    if (mp[k][x][y] == '.') return true;
  return false;
}
int solve(int k, int num) {
  memset(v, 0, sizeof(v));
  int count = 0;
  for (int i = 0; i < num; i++) {
    int x = node[i].x;
    int y = node[i].y;
    if (mp[k][x][y] == '#') continue;
    if (!ok[k][x][y]) is_ok = 0;
    ok[k][x][y] = 1;
    v[x][y] = 1;
    for (int i = 0; i < 4; i++)
      if (legal(x + d[i][0], y + d[i][1], k) && !v[x + d[i][0]][y + d[i][1]]) {
        if (!ok[k][x + d[i][0]][y + d[i][1]]) is_ok = 0;
        ok[k][x + d[i][0]][y + d[i][1]] = 1;
        node[num].x = x + d[i][0];
        node[num++].y = y + d[i][1];
        v[x + d[i][0]][y + d[i][1]] = 1;
      }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (ok[k][i][j]) {
        node[count].x = i;
        node[count++].y = j;
      }
  return count;
}
int main() {
  int k;
  cin >> k >> n >> m;
  for (int i = 0; i < k; i++) {
    getchar();
    getchar();
    for (int j = 0; j < n; j++) scanf("%s", mp[i][j]);
  }
  int st, sy;
  cin >> st >> sy;
  int num = 0, ans = 0;
  node[num++].init(st - 1, sy - 1);
  while (!is_ok) {
    is_ok = 1;
    for (int i = 0; i < k; i++) num = solve(i, num);
    for (int i = k - 2; i >= 0; i--) num = solve(i, num);
  }
  for (int i = 0; i < k; i++)
    for (int j = 0; j < n; j++)
      for (int o = 0; o < m; o++)
        if (ok[i][j][o]) ans++;
  cout << ans << endl;
}
