#include <bits/stdc++.h>
using namespace std;
char graph[11][11][11];
bool vis[11][11][11];
int k, n, m, x, y, z;
char c;
int cnt = 1;
int dir[6][3] = {{0, 0, 1},  {0, 0, -1}, {0, 1, 0},
                 {0, -1, 0}, {1, 0, 0},  {-1, 0, 0}};
typedef struct {
  int XCoord, YCoord, ZCoord;
} SpacePoint;
queue<SpacePoint> q;
bool isValid(int xParam, int yParam, int zParam) {
  if (xParam > 0 && yParam > 0 && zParam > 0 && xParam <= n && yParam <= m &&
      zParam <= k && !vis[zParam][xParam][yParam] &&
      graph[zParam - 1][xParam - 1][yParam - 1] == '.') {
    return true;
  } else {
    return false;
  }
}
int main() {
  cin >> k >> n >> m;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) {
      for (int w = 0; w < m; w++) {
        cin >> c;
        graph[i][j][w] = c;
      }
    }
  }
  cin >> x >> y;
  z = 1;
  SpacePoint firstPoint;
  firstPoint.XCoord = x;
  firstPoint.YCoord = y;
  firstPoint.ZCoord = z;
  q.push(firstPoint);
  vis[z][x][y] = true;
  SpacePoint curr;
  while (!q.empty()) {
    curr = q.front();
    q.pop();
    for (int i = 0; i < 6; i++) {
      x = curr.XCoord + dir[i][0];
      y = curr.YCoord + dir[i][1];
      z = curr.ZCoord + dir[i][2];
      if (isValid(x, y, z)) {
        SpacePoint nextPoint;
        nextPoint.XCoord = x;
        nextPoint.YCoord = y;
        nextPoint.ZCoord = z;
        q.push(nextPoint);
        vis[z][x][y] = true;
        cnt++;
      }
    }
  }
  cout << cnt;
  return 0;
}
