#include <bits/stdc++.h>
using namespace std;
int N, M, K;
string arr[103][103];
int cont;
int X[] = {1, 0, 0};
int Y[] = {0, 1, 0};
int Z[] = {0, 0, 1};
bool dentro(int x, int y, int z) {
  if (x < 0 || y < 0 || z < 0 || x >= N || y >= M || z >= K) return false;
  return true;
}
bool process(int x, int y, int z) {
  int xx1, xx2, xx3;
  int yy1, yy2, yy3;
  int zz1, zz2, zz3;
  for (int i = 0; i < 3; i++) {
    xx1 = x - X[i];
    yy1 = y - Y[i];
    zz1 = z - Z[i];
    if (dentro(xx1, yy1, zz1) && arr[xx1][yy1][zz1] == '1') {
      xx2 = x + X[i];
      yy2 = y + Y[i];
      zz2 = z + Z[i];
      if (dentro(xx2, yy2, zz2) && arr[xx2][yy2][zz2] == '1') {
        return true;
      }
      for (int j = 0; j < 3; j++) {
        if (i == j) continue;
        xx2 = x + X[j];
        yy2 = y + Y[j];
        zz2 = z + Z[j];
        if (!dentro(xx2, yy2, zz2) || arr[xx2][yy2][zz2] == '0') continue;
        xx3 = xx2 - X[i];
        yy3 = yy2 - Y[i];
        zz3 = zz2 - Z[i];
        if (!dentro(xx3, yy3, zz3)) continue;
        if (arr[xx3][yy3][zz3] != '1') {
          return true;
        }
      }
    }
  }
  return false;
}
int main() {
  cin >> N >> M >> K;
  int res = 0;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < M; j++) cin >> arr[i][j];
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      for (int k = 0; k < K; k++) {
        if (arr[i][j][k] == '1' && process(i, j, k)) {
          res++;
        }
      }
    }
  }
  cout << res << endl;
  return 0;
}
