#include <bits/stdc++.h>
using namespace std;
int a[1000];
int sx, sy;
int k, n, m;
int cnt;
char s[11][11][11];
int vis[11][11][11];
int dir1[4][2] = {{1, 0}, {-1, 0}, {0, -1}, {0, 1}};
int dir2[2] = {1, -1};
struct node {
  int x, y, z;
};
void bfs() {
  cnt = 1;
  queue<node> q;
  int i, j;
  node no, ne;
  no.x = sx - 1;
  no.y = sy - 1;
  no.z = 0;
  vis[0][no.x][no.y] = 1;
  q.push(no);
  while (!q.empty()) {
    no = q.front();
    q.pop();
    for (i = 0; i < 4; i++) {
      ne.x = no.x + dir1[i][0];
      ne.y = no.y + dir1[i][1];
      ne.z = no.z;
      if (ne.z < 0 || ne.x < 0 || ne.y < 0 || ne.x >= n || ne.y >= m ||
          ne.z >= k || vis[ne.z][ne.x][ne.y] || s[ne.z][ne.x][ne.y] == '#')
        continue;
      vis[ne.z][ne.x][ne.y] = 1;
      cnt++;
      q.push(ne);
    }
    for (j = 0; j < 2; j++) {
      ne.x = no.x;
      ne.y = no.y;
      ne.z = no.z + dir2[j];
      if (ne.z >= 0 && ne.x >= 0 && ne.y >= 0 && ne.x < n && ne.y < m &&
          ne.z < k && !vis[ne.z][ne.x][ne.y] && s[ne.z][ne.x][ne.y] == '.') {
        vis[ne.z][ne.x][ne.y] = 1;
        cnt++;
        q.push(ne);
      }
    }
  }
}
int main() {
  int i, j, t;
  scanf("%d%d%d", &k, &n, &m);
  getchar();
  for (t = 0; t < k; t++) {
    bool flag = false;
    getchar();
    for (i = 0; i < n; i++) {
      int cnt = 0;
      for (j = 0; j < m; j++) {
        vis[t][i][j] = 0;
        scanf("%c", &s[t][i][j]);
      }
      getchar();
    }
  }
  scanf("%d%d", &sx, &sy);
  bfs();
  cout << cnt << endl;
  return 0;
}
