#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long linf = 0x3f3f3f3fLL;
const int EPS = 1e-6;
char matrix[15][15][15];
int d[15][15][15];
int main() {
  int k, n, m;
  scanf("%d %d %d", &k, &n, &m);
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) {
      scanf(" %s", matrix[i][j]);
    }
  }
  int x, y;
  scanf("%d %d", &x, &y);
  x--;
  y--;
  queue<pair<int, pair<long long, long long> > > q;
  q.push(make_pair(0, pair<long long, long long>(x, y)));
  d[0][x][y] = 1;
  int cont = 0;
  while (!q.empty()) {
    pair<int, pair<long long, long long> > front = q.front();
    q.pop();
    cont++;
    for (int w = 0; w < 6; w++) {
      int i = front.second.first + int(w == 0) - int(w == 1);
      int j = front.second.second + int(w == 2) - int(w == 3);
      int z = front.first + int(w == 4) - int(w == 5);
      if (d[z][i][j]) continue;
      if (i < 0 || i >= n) continue;
      if (j < 0 || j >= m) continue;
      if (z < 0 || z >= k) continue;
      if (matrix[z][i][j] == '#') continue;
      d[z][i][j] = 1;
      q.push(make_pair(z, pair<long long, long long>(i, j)));
    }
  }
  printf("%d\n", cont);
  return 0;
}
