#include <bits/stdc++.h>
using namespace std;
vector<long long> g[1000001];
bool st[101][101][101];
signed main() {
  long long n, m, k;
  cin >> n >> m >> k;
  vector<vector<string> > v;
  for (long long i = 0; i < n; i++) {
    vector<string> temp;
    v.push_back(temp);
    for (long long j = 0; j < m; j++) {
      string x;
      cin >> x;
      v[i].push_back(x);
    }
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      for (long long l = 0; l < k; l++) {
        if (v[i][j][l] == '1') {
          if (i - 1 >= 0 && v[i - 1][j][l] == '1') {
            if (i + 1 < n && v[i + 1][j][l] == '1') {
              ans++;
              continue;
            }
            if (j + 1 < m && v[i][j + 1][l] == '1' &&
                v[i - 1][j + 1][l] == '0') {
              ans++;
              continue;
            }
            if (l + 1 < k && v[i][j][l + 1] == '1' &&
                v[i - 1][j][l + 1] == '0') {
              ans++;
              continue;
            }
          }
          if (j - 1 >= 0 && v[i][j - 1][l] == '1') {
            if (j + 1 < m && v[i][j + 1][l] == '1') {
              ans++;
              continue;
            }
            if (i + 1 < n && v[i + 1][j][l] == '1' &&
                v[i + 1][j - 1][l] == '0') {
              ans++;
              continue;
            }
            if (l + 1 < k && v[i][j][l + 1] == '1' &&
                v[i][j - 1][l + 1] == '0') {
              ans++;
              continue;
            }
          }
          if (l - 1 >= 0 && v[i][j][l - 1] == '1') {
            if (l + 1 < k && v[i][j][l + 1] == '1') {
              ans++;
              continue;
            }
            if (i + 1 < n && v[i + 1][j][l] == '1' &&
                v[i + 1][j][l - 1] == '0') {
              ans++;
              continue;
            }
            if (j + 1 < m && v[i][j + 1][l] == '1' &&
                v[i][j + 1][l - 1] == '0') {
              ans++;
              continue;
            }
          }
        }
      }
    }
  }
  cout << ans;
}
