#include <bits/stdc++.h>
using namespace std;
int n, m, k, a[102][102][102], res, was;
int change[3][3];
int main() {
  change[0][0] = 1;
  change[1][1] = 1;
  change[2][2] = 1;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      for (int q = 1; q <= k; q++) scanf("%1d", &a[i][j][q]);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      for (int z = 1; z <= k; z++) {
        was = 0;
        for (int q = 0; q < 3; q++)
          for (int q1 = 0; q1 < 3; q1++) {
            if (was) continue;
            if (a[i][j][z])
              if (a[i + change[0][q]][j + change[1][q]][z + change[2][q]] &&
                  a[i - change[0][q1]][j - change[1][q1]][z - change[2][q1]])
                if (q == q1) {
                  res++;
                  was = 1;
                } else if (!a[i + change[0][q] - change[0][q1]]
                             [j + change[1][q] - change[1][q1]]
                             [z + change[2][q] - change[2][q1]]) {
                  res++;
                  was = 1;
                }
          }
      }
  printf("%d\n", res);
}
