#include <bits/stdc++.h>
using namespace std;
struct cell {
  long long a, b, c;
  cell(long long x, long long y, long long z) : a(x), b(y), c(z) {}
};
long long x, y, z;
vector<vector<vector<char>>> adj;
bool issafe(long long a, long long b, long long c) {
  return (a >= 0 && b >= 0 && c >= 0 && a < x && b < y && c < z &&
          adj[a][b][c] == '.');
}
long long dx[] = {0, 0, 1, -1, 0, 0};
long long dy[] = {0, 0, 0, 0, 1, -1};
long long dz[] = {1, -1, 0, 0, 0, 0};
long long BFS(long long a, long long b, long long c) {
  long long ans = 0;
  adj[a][b][c] = '-';
  queue<cell> q;
  cell p(a, b, c);
  q.push(p);
  while (!q.empty()) {
    auto u = q.front();
    ans++;
    q.pop();
    for (long long i = 0; i < 6; i++) {
      long long newx = u.a + dx[i];
      long long newy = u.b + dy[i];
      long long newz = u.c + dz[i];
      if (issafe(newx, newy, newz)) {
        adj[newx][newy][newz] = '-';
        cell p(newx, newy, newz);
        q.push(p);
      }
    }
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> z >> x >> y;
  adj.resize(x, vector<vector<char>>(y, vector<char>(z)));
  for (long long k = 0; k < z; k++) {
    for (long long i = 0; i < x; i++) {
      for (long long j = 0; j < y; j++) {
        cin >> adj[i][j][k];
      }
    }
  }
  long long a, b;
  cin >> a >> b;
  cout << BFS(a - 1, b - 1, 0) << endl;
}
