#include <bits/stdc++.h>
using namespace std;
short int k, n, m, x, y;
queue<pair<pair<short int, short int>, short int> > q;
short int vis[11][11][11];
int main() {
  cin >> k >> n >> m;
  char arr[k + 1][n + 1][m + 1];
  for (short int i = 1; i <= k; i++) {
    for (short int j = 1; j <= n; j++) {
      for (short int z = 1; z <= m; z++) {
        cin >> arr[i][j][z];
      }
    }
    cin >> ws;
  }
  cin >> x >> y;
  short int dn[] = {1, -1, 0, 0, 0, 0};
  short int dm[] = {0, 0, 1, -1, 0, 0};
  short int dk[] = {0, 0, 0, 0, -1, 1};
  q.push(make_pair(make_pair(1, x), y));
  pair<pair<short int, short int>, short int> c;
  x = 0;
  while (q.size()) {
    c = q.front();
    q.pop();
    arr[c.first.first][c.first.second][c.second] = 'x';
    x++;
    for (short int i = 0; i < 6; i++) {
      short int nextK = c.first.first + dk[i];
      short int nextX = c.first.second + dn[i];
      short int nextY = c.second + dm[i];
      if (!(nextK < 1 || nextK > k || nextX < 1 || nextX > n || nextY < 1 ||
            nextY > m))
        if (arr[nextK][nextX][nextY] == '.' && !vis[nextK][nextX][nextY]) {
          q.push(make_pair(make_pair(nextK, nextX), nextY));
          vis[nextK][nextX][nextY] = 1;
        }
    }
  }
  cout << x;
  return 0;
}
