#include <bits/stdc++.h>
using namespace std;
const int N = 105;
bool state[N][N][N];
bool used[N][N][N];
int cv[N][N][N];
bool bad[N][N][N];
int n, m, k;
int bord[3];
int fd[3][3] = {{-1, 0, 0}, {0, -1, 0}, {0, 0, -1}};
int td[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
bool checkCoord(int *c) {
  for (int i = 0; i < 3; i++) {
    if (c[i] <= 0 || c[i] > bord[i]) {
      return false;
    }
  }
  if (!state[c[0]][c[1]][c[2]]) {
    return false;
  }
  return true;
}
bool areEq(int *from, int *to) {
  for (int i = 0; i < 3; i++) {
    if (from[i] != to[i]) {
      return false;
    }
  }
  return true;
}
bool check(int *from, int *to, int c) {
  if (!checkCoord(from)) {
    return false;
  }
  if (c > 2) {
    return false;
  }
  if (areEq(from, to)) {
    return true;
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      from[j] += td[i][j];
    }
    if (check(from, to, c + 1)) return true;
    for (int j = 0; j < 3; j++) {
      from[j] += fd[i][j];
    }
  }
  return false;
}
int main() {
  cin >> n >> m >> k;
  bord[0] = n;
  bord[1] = m;
  bord[2] = k;
  string s;
  int v = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> s;
      for (int z = 1; z <= k; z++) {
        state[i][j][z] = (s[z - 1] == '1');
        cv[i][j][z] = v++;
      }
    }
  }
  int from[3];
  int to[3];
  int res = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int z = 1; z <= k; z++) {
        if (!state[i][j][z]) continue;
        bool isBad = false;
        for (int d1 = 0; d1 < 3; d1++) {
          if (isBad) break;
          for (int d2 = 0; d2 < 3; d2++) {
            if (isBad) break;
            from[0] = i + fd[d1][0];
            from[1] = j + fd[d1][1];
            from[2] = z + fd[d1][2];
            to[0] = i + td[d2][0];
            to[1] = j + td[d2][1];
            to[2] = z + td[d2][2];
            if (!checkCoord(from) || !checkCoord(to)) continue;
            state[i][j][z] = false;
            if (!check(from, to, 0)) {
              if (i == 1 && j == 3 && z == 3) {
              }
              res++;
              isBad = true;
            }
            state[i][j][z] = true;
          }
        }
      }
    }
  }
  cout << res << "\n";
  return 0;
}
