#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 100;
const int MAXM = 100;
const int MAXK = 100;
int n, m, k;
char g[MAXN][MAXM][MAXK + 1];
bool test(int x, int y, int z) {
  for (int pd = (0); pd < (3); ++pd) {
    int px = x - (pd == 0 ? 1 : 0), py = y - (pd == 1 ? 1 : 0),
        pz = z - (pd == 2 ? 1 : 0);
    if (px < 0 || py < 0 || pz < 0 || g[px][py][pz] != '1') continue;
    for (int nd = (0); nd < (3); ++nd) {
      int nx = x + (nd == 0 ? 1 : 0), ny = y + (nd == 1 ? 1 : 0),
          nz = z + (nd == 2 ? 1 : 0);
      if (nx >= n || ny >= m || nz >= k || g[nx][ny][nz] != '1') continue;
      if (pd == nd) return true;
      int xx = px + (nd == 0 ? 1 : 0), yy = py + (nd == 1 ? 1 : 0),
          zz = pz + (nd == 2 ? 1 : 0);
      if (g[xx][yy][zz] == '0')
        return true;
      else
        continue;
    }
  }
  return false;
}
void run() {
  scanf("%d%d%d", &n, &m, &k);
  for (int x = (0); x < (n); ++x)
    for (int y = (0); y < (m); ++y) scanf("%s", g[x][y]);
  int ret = 0;
  for (int x = (0); x < (n); ++x)
    for (int y = (0); y < (m); ++y)
      for (int z = (0); z < (k); ++z)
        if (g[x][y][z] == '1') {
          if (test(x, y, z)) ++ret;
        }
  printf("%d\n", ret);
}
int main() {
  run();
  return 0;
}
