#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:264777216")
const int size = 11;
char field[size][size][size];
bool color[size][size][size];
int res;
int k, n, m;
void dfs(int t, int i, int j) {
  if (t >= k || t < 0) return;
  if (i >= n || i < 0) return;
  if (j >= m || j < 0) return;
  if (color[t][i][j]) return;
  color[t][i][j] = 1;
  if (field[t][i][j] == '#') return;
  ++res;
  dfs(t + 1, i, j);
  dfs(t - 1, i, j);
  dfs(t, i + 1, j);
  dfs(t, i - 1, j);
  dfs(t, i, j + 1);
  dfs(t, i, j - 1);
}
void Solve() {
  cin >> k >> n >> m;
  for (int t = 0; t < k; ++t) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        cin >> field[t][i][j];
        color[t][i][j] = 0;
      }
    }
  }
  int x, y;
  cin >> x >> y;
  --x;
  --y;
  res = 0;
  dfs(0, x, y);
  cout << res << endl;
}
int main() {
  Solve();
  return 0;
}
