#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, n, m;
  int count = 0;
  cin >> k >> n >> m;
  char dish[k][n][m];
  bool visited[k][n][m];
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < n; j++) {
      string line;
      cin >> line;
      for (int p = 0; p < m; p++) {
        dish[i][j][p] = line[p];
        visited[i][j][p] = false;
      }
    }
  }
  int start_x, start_y;
  cin >> start_x >> start_y;
  deque<tuple<int, int, int> > q;
  q.push_front(make_tuple(0, start_x - 1, start_y - 1));
  while (!q.empty()) {
    tuple<int, int, int> current = q.front();
    q.pop_front();
    int first = get<0>(current), second = get<1>(current),
        third = get<2>(current);
    if (first < 0 || first >= k || second < 0 || second >= n || third < 0 ||
        third >= m)
      continue;
    if (visited[first][second][third]) continue;
    visited[first][second][third] = true;
    if (dish[first][second][third] == '#') continue;
    if (dish[first][second][third] == '.') count++;
    q.push_front(make_tuple(first + 1, second, third));
    q.push_front(make_tuple(first - 1, second, third));
    q.push_front(make_tuple(first, second + 1, third));
    q.push_front(make_tuple(first, second - 1, third));
    q.push_front(make_tuple(first, second, third + 1));
    q.push_front(make_tuple(first, second, third - 1));
  }
  cout << count;
}
