#include <bits/stdc++.h>
using namespace std;
bool a[20][20][20];
bool visited[20][20][20];
int dir[6][3] = {{1, 0, 0},  {-1, 0, 0}, {0, 1, 0},
                 {0, -1, 0}, {0, 0, 1},  {0, 0, -1}};
int n, m, k;
int number;
void dfs(int z, int x, int y) {
  if (a[z][x][y] == false) return;
  visited[z][x][y] = true;
  number++;
  for (int(i) = 0; (i) < (6); (i)++) {
    int tz = z + dir[i][0];
    int tx = x + dir[i][1];
    int ty = y + dir[i][2];
    if (tz < 0 || tz >= k || tx < 0 || tx >= n || ty < 0 || ty >= m) continue;
    if (a[tz][tx][ty] == false) continue;
    if (!visited[tz][tx][ty]) {
      dfs(tz, tx, ty);
    }
  }
}
int main() {
  while (cin >> k >> n >> m) {
    memset((a), (false), sizeof(a));
    memset((visited), (false), sizeof(visited));
    for (int(kk) = 0; (kk) < (k); (kk)++)
      for (int(i) = 0; (i) < (n); (i)++) {
        string s;
        cin >> s;
        for (int(j) = 0; (j) < (m); (j)++)
          a[kk][i][j] = (s[j] == '.') ? true : false;
      }
    int x, y;
    cin >> x >> y;
    number = 0;
    dfs(0, x - 1, y - 1);
    cout << number << endl;
  }
}
