#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, n, m;
  cin >> k >> n >> m;
  vector<vector<vector<int>>> a(k, vector<vector<int>>(n, vector<int>(m)));
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) {
      string s;
      cin >> s;
      for (int l = 0; l < m; l++)
        if (s[l] == '.') a[i][j][l] = 1;
    }
  }
  int x, y;
  cin >> x >> y;
  x--, y--;
  queue<vector<int>> q;
  vector<vector<vector<int>>> v(k, vector<vector<int>>(n, vector<int>(m)));
  vector<int> nv = {0, x, y};
  q.push(nv);
  v[0][x][y] = 1;
  int c = 0;
  while (!q.empty()) {
    vector<int> vv = q.front();
    q.pop();
    c++;
    int r = vv[0], s = vv[1], t = vv[2];
    if (r - 1 >= 0 && v[r - 1][s][t] == 0 && a[r - 1][s][t] == 1) {
      v[r - 1][s][t] = 1;
      vector<int> nv = {r - 1, s, t};
      q.push(nv);
    }
    if (r + 1 < k && v[r + 1][s][t] == 0 && a[r + 1][s][t] == 1) {
      v[r + 1][s][t] = 1;
      vector<int> nv = {r + 1, s, t};
      q.push(nv);
    }
    if (s - 1 >= 0 && v[r][s - 1][t] == 0 && a[r][s - 1][t] == 1) {
      v[r][s - 1][t] = 1;
      vector<int> nv = {r, s - 1, t};
      q.push(nv);
    }
    if (t - 1 >= 0 && v[r][s][t - 1] == 0 && a[r][s][t - 1] == 1) {
      v[r][s][t - 1] = 1;
      vector<int> nv = {r, s, t - 1};
      q.push(nv);
    }
    if (s + 1 < n && v[r][s + 1][t] == 0 && a[r][s + 1][t] == 1) {
      v[r][s + 1][t] = 1;
      vector<int> nv = {r, s + 1, t};
      q.push(nv);
    }
    if (t + 1 < m && v[r][s][t + 1] == 0 && a[r][s][t + 1] == 1) {
      v[r][s][t + 1] = 1;
      vector<int> nv = {r, s, t + 1};
      q.push(nv);
    }
  }
  cout << c << endl;
  return 0;
}
