#include <bits/stdc++.h>
using namespace std;
int n, m, k;
char s[105][105][105];
int p[105][105][105];
int i, j, l, ans;
int dx[3] = {1, 0, 0};
int dy[3] = {0, 1, 0};
int dz[3] = {0, 0, 1};
int bfs(int i, int j, int l, int io, int jo, int lo) {
  int t, tx, ty, tz;
  int qx[20], qy[20], qz[20], h[20];
  int used[3][3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
  int head = 0, tail = 1;
  int res = 0;
  qx[0] = i;
  qy[0] = j;
  qz[0] = l;
  h[0] = 0;
  while (head < tail && h[head] < 2) {
    for (t = 0; t < 3; t++) {
      tx = qx[head] + dx[t];
      ty = qy[head] + dy[t];
      tz = qz[head] + dz[t];
      if (p[tx][ty][tz] == 1 && !used[tx - i][ty - j][tz - l]) {
        used[tx - i][ty - j][tz - l] = 1;
        qx[tail] = tx;
        qy[tail] = ty;
        qz[tail] = tz;
        h[tail] = h[head] + 1;
        tail++;
        if (tx != io || ty != jo || tz != lo) res++;
      }
    }
    head++;
  }
  return res;
}
int solve(int i, int j, int l) {
  int t1, t2, t;
  if (p[i][j][l] != 1) return 0;
  for (t = 0; t < 3; t++)
    if (p[i - dx[t]][j - dy[t]][l - dz[t]] == 1) {
      t1 = bfs(i - dx[t], j - dy[t], l - dz[t], i, j, l);
      p[i][j][l] = 0;
      t2 = bfs(i - dx[t], j - dy[t], l - dz[t], i, j, l);
      p[i][j][l] = 1;
      if (t1 != t2) {
        return 1;
      }
    }
  return 0;
}
int main() {
  scanf("%d %d %d", &n, &m, &k);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      scanf("%s", s[i][j]);
    }
  }
  for (i = 0; i <= n + 1; i++)
    for (j = 0; j <= m + 1; j++)
      for (l = 0; l <= k + 1; l++) {
        if (!i || i == n + 1 || !j || j == m + 1 || !l || l == k + 1)
          p[i][j][l] = -1;
        else
          p[i][j][l] = s[i][j][l - 1] - '0';
      }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      for (l = 1; l <= k; l++) ans += solve(i, j, l);
  printf("%d\n", ans);
  return 0;
}
