#include <bits/stdc++.h>
using namespace std;
int arr[11][11][11];
int n, m, k;
int dfs(int lvl, int str, int stb) {
  if (lvl > k || lvl < 1 || str > n || str < 1 || stb > m || stb < 1) return 0;
  if (arr[lvl][str][stb] != 0) return 0;
  int ans = 1;
  arr[lvl][str][stb] = 2;
  ans += dfs(lvl + 1, str, stb);
  ans += dfs(lvl - 1, str, stb);
  ans += dfs(lvl, str + 1, stb);
  ans += dfs(lvl, str - 1, stb);
  ans += dfs(lvl, str, stb + 1);
  ans += dfs(lvl, str, stb - 1);
  return ans;
}
int main() {
  cin >> k >> n >> m;
  string str;
  for (int i = k; i > 0; i--)
    for (int j = 1; j <= n; j++) {
      cin >> str;
      for (int l = 1; l <= m; l++)
        if (str[l - 1] == '#') arr[i][j][l] = 1;
    }
  int x, y;
  cin >> x >> y;
  cout << dfs(k, x, y);
  return 0;
}
