#include <bits/stdc++.h>
using namespace std;
int k, n, m, ans = 0;
int dx[] = {0, 0, 0, 0, -1, 1};
int dy[] = {0, 0, 1, -1, 0, 0};
int dz[] = {1, -1, 0, 0, 0, 0};
char a[11][11][11];
bool vis[11][11][11];
void dfs(int x, int y, int z) {
  if (x < 0 || y < 0 || z < 0 || x >= n || y >= m || z >= k ||
      a[x][y][z] == '#' || vis[x][y][z])
    return;
  vis[x][y][z] = 1;
  ans++;
  int xx, yy, zz;
  for (int i = 0; i < 6; i++) {
    xx = x + dx[i];
    yy = y + dy[i];
    zz = z + dz[i];
    dfs(xx, yy, zz);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> k >> n >> m;
  for (int t = 0; t < k; t++) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        cin >> a[i][j][t];
      }
    }
  }
  int x, y;
  cin >> x >> y;
  dfs(x - 1, y - 1, 0);
  cout << ans;
}
