#include <bits/stdc++.h>
using namespace std;
const int N = 105;
char str[N];
char matrix[N][N][N];
int dx[] = {-1, 0, 0}, dy[] = {0, -1, 0}, dz[] = {0, 0, -1};
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, k;
  scanf("%d %d %d\n", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      scanf("%s\n", str);
      for (int p = 0; p < k; p++) {
        int val = str[p] == '1';
        matrix[i][j][p] = val;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      for (int p = 0; p < k; p++) {
        if (matrix[i][j][p] == false) continue;
        bool flag = false;
        for (int shift = 0; shift < 3; shift++) {
          int ni = i + dx[shift], nj = j + dy[shift], np = p + dz[shift];
          if (!(ni >= 0 && nj >= 0 && np >= 0 && matrix[ni][nj][np])) {
            continue;
          }
          int rni = i - dx[shift], rnj = j - dy[shift], rnp = p - dz[shift];
          if (rni < n && rnj < m && rnp < k && matrix[rni][rnj][rnp]) {
            flag = true;
            break;
          }
          for (int shift2 = 0; shift2 < 3; shift2++) {
            if (shift == shift2) continue;
            rni = i - dx[shift2];
            rnj = j - dy[shift2];
            rnp = p - dz[shift2];
            if (!(rni < n && rnj < m && rnp < k && matrix[rni][rnj][rnp])) {
              continue;
            }
            rni = ni - dx[shift2];
            rnj = nj - dy[shift2];
            rnp = np - dz[shift2];
            if (!matrix[rni][rnj][rnp]) {
              flag = true;
            }
          }
        }
        if (flag) ans++;
      }
    }
  }
  printf("%d\n", ans);
}
