#include <bits/stdc++.h>
int n, m, k, a[102][102][102], ans, flag, move[3][3];
int main() {
  move[0][0] = 1;
  move[1][1] = 1;
  move[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++) {
        flag = 0;
        for (int q = 0; q < 3; q++)
          for (int q1 = 0; q1 < 3; q1++) {
            if (flag) continue;
            if (a[i][j][z])
              if (a[i + move[0][q]][j + move[1][q]][z + move[2][q]] &&
                  a[i - move[0][q1]][j - move[1][q1]][z - move[2][q1]]) {
                if (q == q1)
                  ans++, flag = 1;
                else if (!a[i + move[0][q] - move[0][q1]]
                           [j + move[1][q] - move[1][q1]]
                           [z + move[2][q] - move[2][q1]])
                  ans++, flag = 1;
              }
          }
      }
  printf("%d\n", ans);
  return 0;
}
