#include <bits/stdc++.h>
int dfs(char ***mat, int d, int x, int y, const int depth, const int rows,
        const int columns) {
  if (d < 0 || x < 0 || y < 0) {
    return 0;
  }
  if (d >= depth || x >= rows || y >= columns) {
    return 0;
  }
  if (mat[d][x][y] != '.') {
    return 0;
  }
  mat[d][x][y] = '#';
  int count = 1;
  count += dfs(mat, d - 1, x, y, depth, rows, columns);
  count += dfs(mat, d + 1, x, y, depth, rows, columns);
  count += dfs(mat, d, x - 1, y, depth, rows, columns);
  count += dfs(mat, d, x + 1, y, depth, rows, columns);
  count += dfs(mat, d, x, y - 1, depth, rows, columns);
  count += dfs(mat, d, x, y + 1, depth, rows, columns);
  return count;
}
int main() {
  int depth, row, col;
  scanf("%d%d%d\n\n", &depth, &row, &col);
  char ***mat = (char ***)malloc(sizeof(char **) * depth);
  for (int d = 0; d < depth; d++) {
    mat[d] = (char **)malloc(sizeof(char *) * row);
    for (int r = 0; r < row; r++) {
      mat[d][r] = (char *)malloc(sizeof(char) * col + 1);
      scanf("%s\n", mat[d][r]);
      mat[d][r][col] = '\0';
    }
  }
  int startX, startY;
  scanf("%d%d", &startX, &startY);
  int res = dfs(mat, 0, startX - 1, startY - 1, depth, row, col);
  printf("%d", res);
  return 0;
}
