#include <bits/stdc++.h>
using namespace std;
int*** arr;
void solve(int x, int y, int z) {
  arr[x][y][z] = 1;
  if (arr[x - 1][y][z] == 0) solve(x - 1, y, z);
  if (arr[x + 1][y][z] == 0) solve(x + 1, y, z);
  if (arr[x][y - 1][z] == 0) solve(x, y - 1, z);
  if (arr[x][y + 1][z] == 0) solve(x, y + 1, z);
  if (arr[x][y][z - 1] == 0) solve(x, y, z - 1);
  if (arr[x][y][z + 1] == 0) solve(x, y, z + 1);
}
void serial(istream& r, ostream& w) {
  int k, n, m, tapX, tapY;
  string s;
  r >> k >> n >> m;
  arr = new int**[k + 2];
  for (int i = 0; i < k + 2; ++i) {
    arr[i] = new int*[n + 2];
    for (int j = 0; j < n + 2; ++j) {
      arr[i][j] = new int[m + 2];
      for (int l = 0; l < m + 2; ++l) arr[i][j][l] = -1;
    }
  }
  for (int i = 1; i <= k; ++i) {
    for (int j = 1; j <= n; ++j) {
      r >> s;
      for (int l = 1; l <= m; ++l) {
        if (s[l - 1] == '.') arr[i][j][l] = 0;
      }
    }
  }
  r >> tapX;
  r >> tapY;
  if (arr[1][tapX][tapY] == 0) {
    solve(1, tapX, tapY);
  } else {
    w << 0 << endl;
    return;
  }
  int sum = 0;
  for (int i = 1; i <= k; ++i) {
    for (int j = 1; j <= n; ++j) {
      for (int l = 1; l <= m; ++l) {
        if (arr[i][j][l] > 0) ++sum;
      }
    }
  }
  w << sum << endl;
}
int main() {
  serial(cin, cout);
  return 0;
}
