#include <bits/stdc++.h>
using namespace std;
const int N = 103;
bool W[N][N][N];
bool check(int i, int j, int l, int checkX = 0, int checkY = 0,
           int checkZ = 0) {
  if (W[i][j][l] && !W[i - checkZ][j - checkY][l - checkX]) return true;
  return false;
}
int main(void) {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    char line[N];
    for (int j = 1; j <= m; j++) {
      scanf("%s", line);
      for (int l = 1; l <= k; l++) {
        if (line[l - 1] == '1') {
          W[i][j][l] = true;
        }
      }
    }
  }
  int res = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int l = 1; l <= k; l++) {
        if (W[i][j][l] && ((W[i][j][l - 1] && W[i][j][l + 1]) ||
                           (W[i][j - 1][l] && W[i][j + 1][l]) ||
                           (W[i - 1][j][l] && W[i + 1][j][l]) ||
                           (W[i][j - 1][l] && check(i, j, l + 1, 0, 1, 0)) ||
                           (W[i][j - 1][l] && check(i + 1, j, l, 0, 1, 0)) ||
                           (W[i][j][l - 1] && check(i, j + 1, l, 1, 0, 0)) ||
                           (W[i][j][l - 1] && check(i + 1, j, l, 1, 0, 0)) ||
                           (W[i - 1][j][l] && check(i, j, l + 1, 0, 0, 1)) ||
                           (W[i - 1][j][l] && check(i, j + 1, l, 0, 0, 1)))) {
          res++;
        }
      }
    }
  }
  cout << res;
  return 0;
}
