#include <bits/stdc++.h>
using namespace std;
int k, n, m, sx, sy;
int mvk[6] = {-1, 0, 0, 0, 0, 1};
int mvx[6] = {0, 0, 0, -1, 1, 0};
int mvy[6] = {0, -1, 1, 0, 0, 0};
bool visited[11][11][11];
bool maze[11][11][11];
bool isvalid(int tl, int tx, int ty) {
  if (tl >= 1 && tl <= k && tx >= 1 && tx <= n && ty >= 1 && ty <= m &&
      !visited[tl][tx][ty] && maze[tl][tx][ty])
    return true;
  return false;
}
int dfs(int l, int x, int y) {
  int ans{1};
  visited[l][x][y] = 1;
  for (int i = 0; i < 6; ++i) {
    int tl{l + mvk[i]}, tx{x + mvx[i]}, ty{y + mvy[i]};
    if (isvalid(tl, tx, ty)) {
      ans += dfs(tl, tx, ty);
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  char c;
  cin >> k >> n >> m;
  for (int i = 1; i <= k; ++i) {
    for (int x = 1; x <= n; ++x) {
      for (int y = 1; y <= m; ++y) {
        cin >> c;
        if (c == '.') maze[i][x][y] = 1;
      }
    }
  }
  cin >> sx >> sy;
  cout << dfs(1, sx, sy) << "\n";
  return 0;
}
