#include <bits/stdc++.h>
using namespace std;
int a, b, c, res;
char s[105][105][105];
int dx[3] = {1, 0, 0};
int dy[3] = {0, 1, 0};
int dz[3] = {0, 0, 1};
bool gg(int x, int y, int z) {
  if (x <= 0 || y <= 0 || z <= 0) return true;
  if (x > a || y > b || z > c) return true;
  if (s[x][y][z] == '0') return true;
  return false;
}
bool tr(int x, int y, int z, int ma, int mb) {
  if (gg(x - dx[ma], y - dy[ma], z - dz[ma])) return false;
  if (gg(x + dx[mb], y + dy[mb], z + dz[mb])) return false;
  if (gg(x, y, z)) return false;
  if (ma == mb)
    return true;
  else
    return gg(x - dx[ma] + dx[mb], y - dy[ma] + dy[mb], z - dz[ma] + dz[mb]);
}
int main() {
  scanf("%d %d %d", &a, &b, &c);
  for (int i = (1); i <= (a); i++) {
    for (int j = (1); j <= (b); j++) scanf(" %s", s[i][j] + 1);
    scanf(" ");
  }
  for (int i = (1); i <= (a); i++)
    for (int j = (1); j <= (b); j++)
      for (int k = (1); k <= (c); k++) {
        bool ok = false;
        for (int y = (0); y <= (2); y++)
          for (int z = (0); z <= (2); z++) {
            ok |= tr(i, j, k, y, z);
          }
        if (ok) res++;
      }
  printf("%d\n", res);
  return 0;
}
