#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30) - 1;
const int DIRX[] = {-1, 0, 0, 1, -1, -1, 1, 1},
          DIRY[] = {0, -1, 1, 0, -1, 1, -1, 1};
const double ERR = 1e-9, PI = (2 * acos(0.0));
template <class T>
inline T MIN(T a, T b) {
  return ((a < b) ? a : b);
}
template <class T>
inline T MAX(T a, T b) {
  return ((b < a) ? a : b);
}
template <class T>
inline void checkMIN(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkMAX(T& a, T b) {
  if (a < b) a = b;
}
template <class T>
inline T SQR(T x) {
  return (x * x);
}
template <class T>
T GCD(T a, T b) {
  if (!b)
    return a;
  else
    return GCD(b, a % b);
}
inline int compareDouble(double x, double y, double err = ERR) {
  double d = x - y;
  if (d > err) return 1;
  if (d < -err) return -1;
  return 0;
}
int cnt, k, n, m, i, j, l;
char mat[22][22][22];
void dfs(int z, int x, int y) {
  if (mat[z][x][y] == '#') return;
  cnt++;
  mat[z][x][y] = '#';
  int w;
  for (w = -1; w <= 1; w += 2)
    if (1 <= z + w and z + w <= k)
      if (mat[z + w][x][y] != '#') dfs(z + w, x, y);
  for (w = -1; w <= 1; w += 2)
    if (1 <= x + w and x + w <= n)
      if (mat[z][x + w][y] != '#') dfs(z, x + w, y);
  for (w = -1; w <= 1; w += 2)
    if (1 <= y + w and y + w <= m)
      if (mat[z][x][y + w] != '#') dfs(z, x, y + w);
}
int main() {
  cin >> k >> n >> m;
  for (l = (1); l <= (k); l++)
    for (i = (1); i <= (n); i++)
      for (j = (1); j <= (m); j++) scanf(" %c", &mat[l][i][j]);
  cin >> i >> j;
  dfs(1, i, j);
  cout << cnt;
  return 0;
}
