#include <bits/stdc++.h>
using namespace std;
const int MAXN = 12;
int b[MAXN][MAXN][MAXN], ans, k, n, m;
bool mark[MAXN][MAXN][MAXN];
void dfs(int i, int j, int l) {
  mark[i][j][l] = true;
  if (j > 0)
    if (b[i][j - 1][l] == 0 && !mark[i][j - 1][l]) {
      ans++;
      dfs(i, j - 1, l);
    }
  if (l > 0)
    if (b[i][j][l - 1] == 0 && !mark[i][j][l - 1]) {
      ans++;
      dfs(i, j, l - 1);
    }
  if (j < n - 1)
    if (b[i][j + 1][l] == 0 && !mark[i][j + 1][l]) {
      ans++;
      dfs(i, j + 1, l);
    }
  if (l < m - 1)
    if (b[i][j][l + 1] == 0 && !mark[i][j][l + 1]) {
      ans++;
      dfs(i, j, l + 1);
    }
  if (i > 0)
    if (b[i - 1][j][l] == 0 && !mark[i - 1][j][l]) {
      ans++;
      dfs(i - 1, j, l);
    }
  if (i < k - 1)
    if (b[i + 1][j][l] == 0 && !mark[i + 1][j][l]) {
      ans++;
      dfs(i + 1, j, l);
    }
}
int main() {
  cin >> k >> n >> m;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) {
      for (int l = 0; l < m; l++) {
        char ch;
        cin >> ch;
        if (ch == '#') b[i][j][l] = 1;
      }
    }
  }
  int x, y;
  cin >> x >> y;
  x--;
  y--;
  dfs(0, x, y);
  cout << ans + 1;
  return 0;
}
