#include <bits/stdc++.h>
using namespace std;
int k, n, m, mx;
bool vis[12][12][12];
string s[12][12];
int dir_z[] = {0, 0, 0, 0, 1, -1};
int dir_x[] = {0, 1, -1, 0, 0, 0};
int dir_y[] = {1, 0, 0, -1, 0, 0};
void dfs(int z, int x, int y) {
  mx++;
  vis[z][x][y] = true;
  for (int i = 0; i < 6; i++) {
    int x1 = x + dir_x[i];
    int y1 = y + dir_y[i];
    int z1 = z + dir_z[i];
    if (z1 < 0 || z1 >= k || x1 < 0 || y1 < 0 || x1 >= n || y1 >= m) continue;
    if (s[z1][x1][y1] == '#') continue;
    if (vis[z1][x1][y1]) continue;
    dfs(z1, x1, y1);
  }
}
int main() {
  int y, z;
  cin >> k >> n >> m;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) cin >> s[i][j];
  }
  cin >> y >> z;
  y--, z--;
  mx = 0;
  dfs(0, y, z);
  cout << mx << endl;
  return 0;
}
