#include <bits/stdc++.h>
using namespace std;
string proc[101][101];
int n, m, k;
bool pathExist(int fi, int fj, int fp, int ti, int tj, int tp) {
  if (fi > ti || fj > tj || fp > tp) return false;
  if (fi == ti && fj == tj && fp == tp) return true;
  if (proc[fi][fj][fp] == '0') return false;
  if (pathExist(fi + 1, fj, fp, ti, tj, tp) ||
      pathExist(fi, fj + 1, fp, ti, tj, tp) ||
      pathExist(fi, fj, fp + 1, ti, tj, tp)) {
    return true;
  }
  return false;
}
bool modto(int &i, int &j, int &p, int to) {
  if (to == 0) {
    i++;
    if (i >= n) return false;
  } else if (to == 1) {
    j++;
    if (j >= m) return false;
  } else if (to == 2) {
    p++;
    if (p >= k) return false;
  }
  if (proc[i][j][p] == '0') return false;
  return true;
}
bool modfrom(int &i, int &j, int &p, int from) {
  if (from == 0) {
    i--;
    if (i < 0) return false;
  } else if (from == 1) {
    j--;
    if (j < 0) return false;
  } else if (from == 2) {
    p--;
    if (p < 0) return false;
  }
  if (proc[i][j][p] == '0') return false;
  return true;
}
bool critical(int i, int j, int p) {
  if (proc[i][j][p] == '0') {
    return false;
  }
  proc[i][j][p] = '0';
  for (int to = 0; to < 3; to++) {
    int toi = i, toj = j, top = p;
    if (modto(toi, toj, top, to)) {
      for (int from = 0; from < 3; from++) {
        int fi = i, fj = j, fp = p;
        if (modfrom(fi, fj, fp, from)) {
          if (!pathExist(fi, fj, fp, toi, toj, top)) {
            proc[i][j][p] = '1';
            return true;
          }
        }
      }
    }
  }
  proc[i][j][p] = '1';
  return false;
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cin >> proc[i][j];
  }
  int res = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      for (int p = 0; p < k; p++) {
        if (critical(i, j, p)) {
          res++;
        }
      }
  cout << res << endl;
  return 0;
}
