#include <bits/stdc++.h>
using namespace std;
const unsigned long long M = 998244353;
char a[20][20][20];
bool vis[20][20][20];
long long K, n, m;
void dfs(long long i, long long j, long long k) {
  if (i >= K || i < 0 || j >= n || j < 0 || k >= m || k < 0) return;
  if (a[i][j][k] == '#' || vis[i][j][k]) return;
  vis[i][j][k] = 1;
  dfs(i - 1, j, k);
  dfs(i + 1, j, k);
  dfs(i, j + 1, k);
  dfs(i, j - 1, k);
  dfs(i, j, k + 1);
  dfs(i, j, k - 1);
}
void solve() {
  cin >> K >> n >> m;
  for (long long i = 0; i < K; i++) {
    for (long long j = 0; j < n; j++) {
      for (long long k = 0; k < m; k++) {
        vis[i][j][k] = 0;
        cin >> a[i][j][k];
      }
    }
  }
  long long x, y;
  cin >> x >> y;
  x--;
  y--;
  dfs(0, x, y);
  long long ans = 0;
  for (long long i = 0; i < K; i++) {
    for (long long j = 0; j < n; j++) {
      for (long long k = 0; k < m; k++) {
        if (vis[i][j][k]) ans++;
      }
    }
  }
  cout << ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
}
