#include <bits/stdc++.h>
using namespace std;
const int maxN = 10 + 5;
char a[maxN][maxN][maxN];
int mark[maxN][maxN][maxN];
int k, n, m;
int dx[] = {-1, 1, 0, 0, 0, 0};
int dy[] = {0, 0, -1, 1, 0, 0};
int dz[] = {0, 0, 0, 0, -1, 1};
int cnt;
void dfs(int x, int y, int z) {
  mark[x][y][z] = 1;
  cnt++;
  for (int i = 0; i < 6; i++) {
    int r = x + dx[i], c = y + dy[i], t = z + dz[i];
    if (r < 0 || c < 0 || t < 0) continue;
    if (r >= k || c >= n || t >= m) continue;
    if (!mark[r][c][t] && a[r][c][t] == '.') dfs(r, c, t);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> k >> n >> m;
  for (int i = 0; i < k; i++)
    for (int j = 0; j < n; j++)
      for (int t = 0; t < m; t++) cin >> a[i][j][t];
  int x, y;
  cin >> x >> y;
  x--;
  y--;
  dfs(0, x, y);
  cout << cnt << endl;
  return 0;
}
