#include <bits/stdc++.h>
using namespace std;
char plate[20][20][20];
int visit[20][20][20] = {0};
int dim_x[3] = {0, 1, -1};
int dim_y[3] = {0, 1, -1};
int dim_z[3] = {0, 1, -1};
void myplate(int k, int n, int m) {
  for (int a = 0; a < 20; a++)
    for (int b = 0; b < 20; b++)
      for (int c = 0; c < 20; c++) {
        plate[a][b][c] = '#';
      }
  for (int a = 1; a < k + 1; a++) {
    for (int b = 1; b < n + 1; b++) {
      for (int c = 1; c < m + 1; c++) {
        cin >> plate[a][b][c];
      }
    }
    cout << endl;
  }
}
void neighbor(int z, int x, int y) {
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++)
      for (int k = 0; k < 3; k++)
        if ((abs(dim_x[i]) + abs(dim_y[j]) + abs(dim_z[k])) < 2)
          if (plate[z + dim_z[i]][x + dim_x[j]][y + dim_y[k]] == '.' &&
              visit[z + dim_z[i]][x + dim_x[j]][y + dim_y[k]] != 1) {
            visit[z + dim_z[i]][x + dim_x[j]][y + dim_y[k]] = 1;
            neighbor(z + dim_z[i], x + dim_x[j], y + dim_y[k]);
          }
}
int count_time() {
  int sum = 0;
  for (int a = 0; a < 20; a++)
    for (int b = 0; b < 20; b++)
      for (int c = 0; c < 20; c++) sum = sum + visit[a][b][c];
  return sum;
}
int main() {
  int k, n, m;
  cin >> k >> n >> m;
  myplate(k, n, m);
  int x, y;
  cin >> x >> y;
  neighbor(1, x, y);
  int time = 0;
  time = count_time();
  cout << time << endl;
  return 0;
}
