#include <bits/stdc++.h>
using namespace std;
int p[10][10][10];
int main() {
  const int dir[][3] = {{-1, 0, 0}, {1, 0, 0},  {0, -1, 0},
                        {0, 1, 0},  {0, 0, -1}, {0, 0, 1}};
  memset(p, 0, sizeof(p));
  int k, n, m;
  string str = "";
  getline(cin, str);
  stringstream ssn(str);
  ssn >> k >> n >> m;
  for (int i = 0; i < k; ++i) {
    getline(cin, str);
    for (int row = 0; row < n; ++row) {
      getline(cin, str);
      for (int col = 0; col < m; ++col) {
        if (str[col] == '#') {
          p[i][row][col] = -1;
        }
      }
    }
  }
  getline(cin, str);
  pair<int, int> tap;
  getline(cin, str);
  stringstream ss(str);
  ss >> tap.first >> tap.second;
  tap.first--;
  tap.second--;
  queue<pair<int, pair<int, int> > > que;
  pair<int, pair<int, int> > start;
  start.first = 0;
  start.second.first = tap.first;
  start.second.second = tap.second;
  que.push(start);
  p[0][tap.first][tap.second] = 1;
  while (!que.empty()) {
    pair<int, pair<int, int> > curr = que.front();
    que.pop();
    int layer = curr.first;
    int row = curr.second.first;
    int col = curr.second.second;
    for (int d = 0; d < 6; ++d) {
      int nl = layer + dir[d][0];
      int nr = row + dir[d][1];
      int nc = col + dir[d][2];
      if (nl < 0 || nl >= k || nr < 0 || nr >= n || nc < 0 || nc >= m) continue;
      if (p[nl][nr][nc] == 0) {
        p[nl][nr][nc] = 1;
        pair<int, pair<int, int> > next;
        next.first = nl;
        next.second.first = nr;
        next.second.second = nc;
        que.push(next);
      }
    }
  }
  int res = 0;
  for (int i = 0; i < k; ++i)
    for (int r = 0; r < n; ++r)
      for (int c = 0; c < m; ++c)
        if (p[i][r][c] == 1) ++res;
  cout << res << endl;
  return 0;
}
