#include <bits/stdc++.h>
using namespace std;
inline int nxt() {
  int first;
  scanf("%d", &first);
  return first;
}
const int N = 111;
string a[N][N];
void solve() {
  cin.sync_with_stdio(0);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  int B[3] = {n - 1, m - 1, k - 1};
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      for (int ij = 0; ij < k; ij++) {
        if (a[i][j][ij] == '0') continue;
        bool ok = true;
        for (int first = 0; first < 3 && ok; first++) {
          for (int second = 0; second < 3 && ok; second++) {
            int X[3] = {i, j, ij}, Y[3] = {i, j, ij};
            X[first]--;
            Y[second]++;
            if (X[first] < 0 || Y[second] > B[second]) continue;
            if (a[X[0]][X[1]][X[2]] == '0' || a[Y[0]][Y[1]][Y[2]] == '0')
              continue;
            if (first == second) {
              ok = false;
            } else {
              X[second]++;
              if (a[X[0]][X[1]][X[2]] == '0') ok = false;
            }
          }
        }
        if (!ok) ans++;
      }
    }
  }
  cout << ans << "\n";
}
int main() {
  solve();
  return 0;
}
