#include <bits/stdc++.h>
using namespace std;
struct stu {
  int x, y, z;
} w, v;
int ar[6] = {0, 0, 0, 0, 1, -1}, br[6] = {1, -1, 0, 0, 0, 0},
    cr[6] = {0, 0, 1, -1, 0, 0};
int main() {
  int k, n, m, i, j;
  char ma[12][12][12];
  scanf("%d %d %d", &k, &n, &m);
  for (i = 1; i <= k; i++) {
    for (j = 1; j <= n; j++) {
      scanf("%s", &ma[i][j][1]);
    }
  }
  scanf("%d %d", &w.y, &w.z);
  w.x = 1;
  queue<stu> q;
  q.push(w);
  bool flag[12][12][12] = {0};
  flag[w.x][w.y][w.z] = 1;
  int ans = 1;
  while (!q.empty()) {
    w = q.front();
    q.pop();
    for (i = 0; i < 6; i++) {
      v.x = w.x + ar[i];
      v.y = w.y + br[i];
      v.z = w.z + cr[i];
      if (v.x <= 0 || v.x > k || v.y <= 0 || v.y > n || v.z <= 0 || v.z > m ||
          flag[v.x][v.y][v.z] || ma[v.x][v.y][v.z] == '#')
        continue;
      ans++;
      flag[v.x][v.y][v.z] = 1;
      q.push(v);
    }
  }
  printf("%d\n", ans);
  return 0;
}
