#include <bits/stdc++.h>
using namespace std;
char grid[11][11][11];
bool visited[11][11][11];
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 k, n, m;
int dfs(int x, int y, int z) {
  if (z >= k || z < 0 || x >= n || x < 0 || y >= m || y < 0) return 0;
  if (grid[x][y][z] == '#' || visited[x][y][z])
    return 0;
  else {
    int ret = 1;
    visited[x][y][z] = true;
    for (int i = 0; i < 6; i++) {
      ret += dfs(x + dx[i], y + dy[i], z + dz[i]);
    }
    return ret;
  }
}
int main() {
  cin >> k >> n >> m;
  for (int z = 0; z < k; z++) {
    for (int x = 0; x < n; x++) {
      for (int y = 0; y < m; y++) {
        char ch;
        cin >> ch;
        if (ch != '.' && ch != '#') {
          y--;
          continue;
        } else {
          grid[x][y][z] = ch;
          visited[x][y][z] = false;
        }
      }
    }
  }
  memset(visited, false, sizeof visited);
  int sx, sy;
  cin >> sx >> sy;
  cout << dfs(sx - 1, sy - 1, 0) << endl;
  return 0;
}
