#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
const int infi = 1e9 + 7;
const long long infl = 1e18;
const double eps = 1e-7;
int dx[] = {0, 0, 1};
int dy[] = {0, 1, 0};
int dz[] = {1, 0, 0};
vector<vector<vector<bool> > > ar;
int n, m, k;
inline bool cor(int x, int y, int z) {
  return x >= 0 && y >= 0 && z >= 0 && x < n && y < m && z < k;
}
inline int check(int x, int y, int z) {
  if (!ar[x][y][z]) return 0;
  for (int i = 0; i < 3; ++i) {
    int nx1 = x + dx[i], ny1 = y + dy[i], nz1 = z + dz[i];
    if (!cor(nx1, ny1, nz1) || !ar[nx1][ny1][nz1]) continue;
    for (int j = 0; j < 3; ++j) {
      int nx2 = x - dx[j], ny2 = y - dy[j], nz2 = z - dz[j];
      if (!cor(nx2, ny2, nz2) || !ar[nx2][ny2][nz2]) continue;
      int nx3 = nx1 - dx[j], ny3 = ny1 - dy[j], nz3 = nz1 - dz[j];
      if (!cor(nx3, ny3, nz3) ||
          ar[nx3][ny3][nz3] && (nx3 != x || ny3 != y || nz3 != z))
        continue;
      return 1;
    }
  }
  return 0;
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> k;
  ar.resize(n);
  for (int i = 0; i < n; ++i) {
    ar[i].resize(m);
    for (int j = 0; j < m; ++j) {
      ar[i][j].resize(k);
      for (int q = 0; q < k; ++q) {
        char a;
        cin >> a;
        ar[i][j][q] = a - '0';
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      for (int q = 0; q < k; ++q) {
        ans += check(i, j, q);
      }
    }
  }
  cout << ans;
  return 0;
}
