#include <bits/stdc++.h>
using namespace std;
const int me = 15;
const int fix = 16;
const int mod = 1.e9 + 7;
const long long big = 1LL << 55;
int t[me][me][me];
string s;
int n, m, k, x, y, result;
void dfs(int x, int y, int z) {
  if (x < 1 || y < 1 || z < 1 || x > n || y > m || z > k) return;
  if (!t[x][y][z]) return;
  t[x][y][z] = 0;
  result++;
  for (int i = -1; i < 2; i++)
    for (int j = -1; j < 2; j++)
      for (int k = -1; k < 2; k++)
        if ((i == 0) + (j == 0) + (k == 0) == 2) dfs(x + i, y + j, z + k);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> k >> n >> m;
  for (int i = k; i >= 1; i--) {
    for (int j = 1; j <= n; j++) {
      cin >> s;
      for (int q = 0; q < m; q++) t[j][q + 1][i] = s[q] == '.' ? 1 : 0;
    }
  }
  cin >> x >> y;
  int g = k;
  while (g > 0 && t[x][y][g] == 0) g--;
  dfs(x, y, g);
  cout << result << endl;
  return 0;
}
