#include <bits/stdc++.h>
using namespace std;
int n, m, k;
char p[111][111][111];
bool check(int i, int j, int q) {
  if (p[i][j][q] == '0') return 0;
  if (p[i - 1][j][q] == '1') {
    if (p[i + 1][j][q] == '1') return 1;
    if (p[i][j + 1][q] == '1') {
      if (p[i - 1][j + 1][q] == '0') return 1;
    }
    if (p[i][j][q + 1] == '1') {
      if (p[i - 1][j][q + 1] == '0') return 1;
    }
  }
  if (p[i][j - 1][q] == '1') {
    if (p[i][j + 1][q] == '1') return 1;
    if (p[i + 1][j][q] == '1') {
      if (p[i + 1][j - 1][q] == '0') return 1;
    }
    if (p[i][j][q + 1] == '1') {
      if (p[i][j - 1][q + 1] == '0') return 1;
    }
  }
  if (p[i][j][q - 1] == '1') {
    if (p[i][j][q + 1] == '1') return 1;
    if (p[i][j + 1][q] == '1') {
      if (p[i][j + 1][q - 1] == '0') return 1;
    }
    if (p[i + 1][j][q] == '1') {
      if (p[i + 1][j][q - 1] == '0') return 1;
    }
  }
  return 0;
}
int main() {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int q = 1; q <= k; q++) {
        scanf(" %c", &p[i][j][q]);
      }
    }
  }
  int res = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int q = 1; q <= k; q++) {
        if (check(i, j, q)) {
          res++;
        }
      }
    }
  }
  printf("%d\n", res);
  return 0;
}
