#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 10, mod = 1e9 + 7, inf = 0x3f3f3f3f;
int a[N][N][N], n, m, k;
const int dx[] = {1, 1, 0};
const int dy[] = {0, 1, 1};
const int dz[] = {1, 0, 1};
int ok(int x, int y, int z) {
  if (a[x - 1][y][z] && a[x + 1][y][z]) return 1;
  if (a[x][y - 1][z] && a[x][y + 1][z]) return 1;
  if (a[x][y][z - 1] && a[x][y][z + 1]) return 1;
  if (a[x - 1][y][z] && a[x][y + 1][z] && !a[x - 1][y + 1][z]) return 1;
  if (a[x + 1][y][z] && a[x][y - 1][z] && !a[x + 1][y - 1][z]) return 1;
  if (a[x - 1][y][z] && a[x][y][z + 1] && !a[x - 1][y][z + 1]) return 1;
  if (a[x + 1][y][z] && a[x][y][z - 1] && !a[x + 1][y][z - 1]) return 1;
  if (a[x][y - 1][z] && a[x][y][z + 1] && !a[x][y - 1][z + 1]) return 1;
  if (a[x][y + 1][z] && a[x][y][z - 1] && !a[x][y + 1][z - 1]) return 1;
  return 0;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int x = 1; x <= n; ++x)
    for (int y = 1; y <= m; ++y)
      for (int z = 1; z <= k; ++z) {
        char ch;
        scanf(" %c", &ch);
        a[x][y][z] = ch - '0';
      }
  int ans = 0;
  for (int x = 1; x <= n; ++x)
    for (int y = 1; y <= m; ++y)
      for (int z = 1; z <= k; ++z)
        if (a[x][y][z] && ok(x, y, z)) ++ans;
  printf("%d\n", ans);
  return 0;
}
