#include <bits/stdc++.h>
using namespace std;
const double PI =
    3.14159265358979323846264338327950288419716939937510582097494459230;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
int gcd(int a, int b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == 1 || b == 1) return 1;
  if (a == b) return a;
  if (a > b)
    return gcd(b, a % b);
  else
    return gcd(a, b % a);
}
int distx[] = {1, 0, 0, -1, 0, 0};
int disty[] = {0, 1, 0, 0, -1, 0};
int distz[] = {0, 0, 1, 0, 0, -1};
int nOfCalls = 1;
char a[15][15][15];
bool vis[15][15][15];
int n, m, k, posx, posy;
void dfs(int x, int y, int z) {
  vis[x][y][z] = true;
  for (int i = 0; i < 6; i++) {
    int xx = x + distx[i];
    int yy = y + disty[i];
    int zz = z + distz[i];
    if (xx >= 0 && yy >= 0 && zz >= 0 && xx < n && yy < m && zz < k &&
        a[xx][yy][zz] == '.' && vis[xx][yy][zz] == false)
      nOfCalls++, dfs(xx, yy, zz);
  }
}
int main() {
  scanf("%d", &k);
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) {
      for (int q = 0; q < m; q++) {
        cin >> a[j][q][i];
      }
    }
  }
  scanf("%d", &posx);
  scanf("%d", &posy);
  dfs(--posx, --posy, 0);
  printf("%d", nOfCalls);
  return 0;
}
