#include <bits/stdc++.h>
using namespace std;
int k, n, m, cnt;
char ch[11][11][11];
bool vis[11][11][11];
void bfs(int x, int y, int dx[], int dy[], int dz[]) {
  vector<int> a, b, c;
  a.push_back(x);
  b.push_back(y);
  c.push_back(1);
  vis[1][y][x] = true;
  cnt++;
  while (a.size() != 0) {
    int x = a.front(), y = b.front(), z = c.front();
    a.erase(a.begin());
    b.erase(b.begin());
    c.erase(c.begin());
    for (int i = 0; i < 6; i++) {
      int xx, yy, zz;
      xx = x + dx[i];
      yy = y + dy[i];
      zz = z + dz[i];
      if (xx < 1 || yy < 1 || zz < 1)
        continue;
      else if (xx > m || yy > n || zz > k)
        continue;
      else if (ch[zz][yy][xx] == '#')
        continue;
      else if (vis[zz][yy][xx])
        continue;
      else {
        vis[zz][yy][xx] = true;
        cnt++;
        a.push_back(xx);
        b.push_back(yy);
        c.push_back(zz);
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int i, j, l, x, y;
  int dx[6] = {1, -1, 0, 0, 0, 0}, dy[6] = {0, 0, 1, -1, 0, 0},
      dz[6] = {0, 0, 0, 0, 1, -1};
  string s;
  cin >> k >> n >> m;
  getline(cin, s);
  getline(cin, s);
  for (l = 1; l <= k; l++) {
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= m; j++) {
        cin >> ch[l][i][j];
        vis[l][i][j] = false;
      }
    }
    getline(cin, s);
    getline(cin, s);
  }
  cin >> x >> y;
  cnt = 0;
  bfs(y, x, dx, dy, dz);
  cout << cnt;
  return 0;
}
