#include <bits/stdc++.h>
using namespace std;
string itoa(int i) {
  stringstream ss;
  ss << i;
  return ss.str();
}
typedef struct _john {
  int v, r, c;
} John;
char p[10][10][10];
int mv[] = {1, -1, 0, 0, 0, 0};
int mr[] = {0, 0, 1, -1, 0, 0};
int mc[] = {0, 0, 0, 0, 1, -1};
int main() {
  int k, n, m;
  cin >> k >> n >> m;
  for (int i = (0); i < (k); ++i) {
    for (int j = (0); j < (n); ++j) {
      for (int c = (0); c < (m); ++c) {
        cin >> p[i][j][c];
      }
    }
  }
  John j;
  j.v = 0;
  cin >> j.r >> j.c;
  j.r--;
  j.c--;
  deque<John> q;
  int res = 1;
  q.push_back(j);
  p[j.v][j.r][j.c] = '#';
  while (!q.empty()) {
    j = q.front();
    q.pop_front();
    for (int i = (0); i < (6); ++i) {
      int v = j.v + mv[i], r = j.r + mr[i], c = j.c + mc[i];
      if (v < 0 || r < 0 || c < 0 || v >= k || r >= n || c >= m) continue;
      if (p[v][r][c] == '#') continue;
      if (p[v][r][c] == '.') {
        res++;
        p[v][r][c] = '#';
        John _j;
        _j.v = v;
        _j.r = r;
        _j.c = c;
        q.push_back(_j);
      }
    }
  }
  cout << res << endl;
  return 0;
}
