#include <bits/stdc++.h>
using namespace std;
const int N = 11;
char A[N][N][N];
bool Vis[N][N][N];
int globSum = 1;
struct TR {
  int l;
  int i;
  int j;
};
void funk(int l, int x, int y, int it, int last, queue<TR> &q1) {
  TR Rio;
  for (int j = l + it; j != last; j += it) {
    if (A[j][x][y] == '.' && A[j][x][y] != 1) {
      Rio.l = j;
      Rio.i = x;
      Rio.j = y;
      q1.push(Rio);
      globSum++;
      A[j][x][y] = 1;
    } else {
      return;
    }
  }
}
void funn(int l, int x, int y, int it, int last, queue<TR> &q1) {
  TR Rio;
  for (int j = x + it; j != last; j += it) {
    if (A[l][j][y] == '.' && A[l][j][y] != 1) {
      Rio.l = l;
      Rio.i = j;
      Rio.j = y;
      q1.push(Rio);
      globSum++;
      A[l][j][y] = 1;
    } else {
      return;
    }
  }
}
void funm(int l, int x, int y, int it, int last, queue<TR> &q1) {
  TR Rio;
  for (int j = y + it; j != last; j += it) {
    if (A[l][x][j] == '.' && A[l][x][j] != 1) {
      Rio.l = l;
      Rio.i = x;
      Rio.j = j;
      q1.push(Rio);
      globSum++;
      A[l][x][j] = 1;
    } else {
      return;
    }
  }
}
int main() {
  int k, n, m;
  cin >> k >> n >> m;
  for (int l = 1; l <= k; l++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        cin >> A[l][i][j];
      }
    }
  }
  int x, y, l;
  cin >> x >> y;
  queue<TR> q1;
  TR Rio;
  Rio.l = 1;
  Rio.i = x;
  Rio.j = y;
  A[1][x][y] = 1;
  q1.push(Rio);
  while (q1.empty() == 0) {
    l = q1.front().l;
    x = q1.front().i;
    y = q1.front().j;
    funk(l, x, y, 1, k + 1, q1);
    funk(l, x, y, -1, 0, q1);
    funn(l, x, y, 1, n + 1, q1);
    funn(l, x, y, -1, 0, q1);
    funm(l, x, y, 1, m + 1, q1);
    funm(l, x, y, -1, 0, q1);
    q1.pop();
  }
  cout << globSum << endl;
  return 0;
}
