#include <bits/stdc++.h>
using namespace std;
int xc[] = {0, 0, 0, 0, 1, -1};
int yc[] = {0, 0, 1, -1, 0, 0};
int zc[] = {1, -1, 0, 0, 0, 0};
vector<vector<vector<int>>> grid(12,
                                 vector<vector<int>>(12, vector<int>(12, -1)));
vector<vector<vector<bool>>> visited(12,
                                     vector<vector<bool>>(12,
                                                          vector<bool>(12, 0)));
int num = 0;
void dfs(int x, int y, int z) {
  visited[x][y][z] = 1;
  num++;
  for (int i = 0; i < 6; i++) {
    int new_x = x + xc[i], new_y = y + yc[i], new_z = z + zc[i];
    if (grid[new_x][new_y][new_z] == '.' && !visited[new_x][new_y][new_z]) {
      dfs(new_x, new_y, new_z);
    }
  }
}
int main() {
  int k, n, m;
  cin >> k >> n >> m;
  for (int ki = 1; ki != k + 1; ki++) {
    for (int ni = 1; ni != n + 1; ni++) {
      string s;
      cin >> s;
      for (int mi = 1; mi != m + 1; mi++) {
        grid[ni][mi][ki] = s[mi - 1];
      }
    }
  }
  int x;
  cin >> x;
  int y;
  cin >> y;
  int z = 1;
  dfs(x, y, z);
  cout << num << endl;
}
