#include <bits/stdc++.h>
using namespace std;
char t[15][15][15];
int n, m, k, l, i, j, h;
int o[100000][3], d, p[15][15][15];
int main() {
  cin >> k >> n >> m;
  for (i = 1; i <= k; ++i) {
    for (j = 1; j <= n; ++j)
      for (l = 1; l <= m; ++l) cin >> t[i][j][l];
  }
  int x, y, z;
  cin >> x >> y;
  j = 1;
  o[0][0] = 1;
  o[0][1] = x;
  o[0][2] = y;
  p[1][x][y] = 1;
  i = 0;
  while (i < j) {
    int ii, jj, kk;
    for (ii = -1; ii < 2; ii++)
      for (jj = -1; jj < 2; jj++)
        for (kk = -1; kk < 2; kk++)
          if (abs(ii) + abs(jj) + abs(kk) == 1) {
            z = o[i][0] + kk;
            x = o[i][1] + ii;
            y = o[i][2] + jj;
            if (x > 0 && x <= n && y > 0 && y <= m && z > 0 && z <= k &&
                !p[z][x][y] && t[z][x][y] == '.') {
              p[z][x][y] = 1;
              o[j][0] = z;
              o[j][1] = x;
              o[j][2] = y;
              ++j;
            }
          }
    ++i;
  }
  cout << j << endl;
  return 0;
}
