#include <bits/stdc++.h>
using namespace std;
const int64_t N = 2e5 + 5;
const int64_t INF = 1e18;
const int64_t MOD = 998244353;
char a[15][15][15];
int64_t k, n, m;
int64_t ans = 0;
void f(int64_t t, int64_t i, int64_t j) {
  if (a[t][i][j] == '#') return;
  a[t][i][j] = '#';
  ans++;
  f(t + 1, i, j);
  f(t - 1, i, j);
  f(t, i + 1, j);
  f(t, i - 1, j);
  f(t, i, j + 1);
  f(t, i, j - 1);
}
int32_t main() {
  cin >> k >> n >> m;
  for (int64_t t = 0; t < k + 2; t++)
    for (int64_t i = 0; i < n + 2; i++)
      for (int64_t j = 0; j < m + 2; j++) a[t][i][j] = '#';
  for (int64_t t = 1; t < k + 1; t++) {
    for (int64_t i = 1; i < n + 1; i++) {
      for (int64_t j = 1; j < m + 1; j++) {
        cin >> a[t][i][j];
      }
    }
  }
  int64_t x, y;
  cin >> x >> y;
  f(1, x, y);
  cout << ans << endl;
}
