#include <bits/stdc++.h>
using namespace std;
vector<vector<string> > g;
int ans = 0;
int dx[] = {-1, 1, 0, 0, 0, 0};
int dy[] = {0, 0, 1, -1, 0, 0};
int dz[] = {0, 0, 0, 0, 1, -1};
void dfs(int x, int y, int z) {
  if (g[x][y][z] == '#') return;
  g[x][y][z] = '#';
  ans++;
  for (int i = 0; i < 6; i++) dfs(x + dx[i], y + dy[i], z + dz[i]);
}
int main() {
  int k, n, m;
  cin >> k >> n >> m;
  g.assign(k + 2, vector<string>(n + 2, string(m + 2, '#')));
  int i, j;
  for (i = 1; i <= k; i++)
    for (j = 1; j <= n; j++) {
      string in;
      cin >> in;
      g[i][j] = string() + '#' + in + '#';
    }
  int x, y;
  cin >> x >> y;
  dfs(1, x, y);
  cout << ans << endl;
  return 0;
}
