#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:100000000")
int matrix[101][101][101];
int vis[101][101][101];
int dx[3] = {1, 0, 0};
int dy[3] = {0, 1, 0};
int dz[3] = {0, 0, 1};
int itt = 0;
int wx, wy, wz, mx, my, mz;
int go(int x, int y, int z) {
  if (vis[x][y][z] == itt) return 0;
  vis[x][y][z] = itt;
  int res = matrix[x][y][z];
  if (res == 0 && x == wx && y == wy && z == wz) res = 1;
  if (matrix[x][y][z] == 0) return res;
  for (int i = 0; i < 3; i++) {
    int nx = x + dx[i];
    int ny = y + dy[i];
    int nz = z + dz[i];
    if (nx > mx || ny > my || nz > mz) continue;
    res += go(nx, ny, nz);
  }
  return res;
}
bool check(int x1, int y1, int z1, int x2, int y2, int z2, int x, int y,
           int z) {
  int cnt = 0;
  int cnt2 = 0;
  for (int i = x1; i <= x2; i++) {
    for (int j = y1; j <= y2; j++) {
      for (int k = z1; k <= z2; k++) {
        if (i == x && j == y && k == z) continue;
        itt++;
        wx = x, wy = y, wz = z;
        mx = x2, my = y2, mz = z2;
        cnt += go(i, j, k);
        matrix[x][y][z] = 0;
        itt++;
        cnt2 += go(i, j, k);
        matrix[x][y][z] = 1;
        if (cnt != cnt2) return true;
      }
    }
  }
  return false;
}
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      for (int l = 0; l < k; l++) {
        scanf("%1d", &matrix[i][j][l]);
      }
    }
  }
  int res = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      for (int l = 0; l < k; l++) {
        int x = i;
        int y = j;
        int z = l;
        if (matrix[x][y][z] == 0) continue;
        if (check(max(x - 1, 0), max(y - 1, 0), max(z - 1, 0),
                  min(x + 1, n - 1), min(y + 1, m - 1), min(z + 1, k - 1), x, y,
                  z))
          res++;
      }
    }
  }
  printf("%d\n", res);
  return 0;
}
