#include <bits/stdc++.h>
using namespace std;
long long counterMinutes = 1, k, n, m;
int x[] = {0, 1, 0, -1, 0, 0}, y[] = {1, 0, -1, 0, 0, 0},
    z[] = {0, 0, 0, 0, 1, -1};
void floodfill(long long linetap, long long coltap, long long depth,
               vector<vector<vector<char>>>& layers,
               vector<vector<vector<bool>>>& visited) {
  for (int it = 0; it < 6; it++) {
    int a = linetap + y[it], b = coltap + x[it], c = depth + z[it];
    if (a >= 0 && b >= 0 && a < n && b < m && c >= 0 && c < k &&
        layers[c][a][b] == '.' && !visited[c][a][b]) {
      counterMinutes++;
      visited[c][a][b] = true;
      floodfill(a, b, c, layers, visited);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> k >> n >> m;
  vector<vector<vector<char>>> layers(k,
                                      vector<vector<char>>(n, vector<char>(m)));
  vector<vector<vector<bool>>> visited(
      k, vector<vector<bool>>(n, vector<bool>(m)));
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) {
      for (int l = 0; l < m; l++) {
        cin >> layers[i][j][l];
      }
    }
  }
  long long linetap, coltap;
  cin >> linetap >> coltap;
  visited[0][linetap - 1][coltap - 1] = true;
  floodfill(linetap - 1, coltap - 1, 0, layers, visited);
  cout << counterMinutes;
  return 0;
}
