#include <bits/stdc++.h>
using namespace std;
int l, kol, r, n, k, e, c, a, b, f;
char m1[200];
vector<vector<vector<int> > > m(110,
                                vector<vector<int> >(110, vector<int>(110)));
vector<vector<vector<int> > > m2(110,
                                 vector<vector<int> >(110, vector<int>(110)));
int x[3][3] = {{1, 1, 0}, {0, 1, 1}, {1, 0, 1}};
int x1[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
vector<vector<vector<int> > > y(3, vector<vector<int> >(2, vector<int>(3)));
int main() {
  y[0][0][0] = 1;
  y[0][0][1] = 0;
  y[0][0][2] = 0;
  y[0][1][0] = 0;
  y[0][1][1] = 1;
  y[0][1][2] = 0;
  y[1][0][0] = 0;
  y[1][0][1] = 1;
  y[1][0][2] = 0;
  y[1][1][0] = 0;
  y[1][1][1] = 0;
  y[1][1][2] = 1;
  y[2][0][0] = 1;
  y[2][0][1] = 0;
  y[2][0][2] = 0;
  y[2][1][0] = 0;
  y[2][1][1] = 0;
  y[2][1][2] = 1;
  scanf("%d%d%d\n", &a, &b, &c);
  for (int i = 1; i <= a; i++) {
    for (int z = 1; z <= b; z++) {
      scanf("%s", &m1);
      for (int j = 0; j < c; j++) m[i][z][j + 1] = m1[j] - '0';
    }
    scanf("\n");
  }
  for (int i = 1; i <= a; i++)
    for (int z = 1; z <= b; z++)
      for (int j = 1; j <= c; j++) {
        if (m[i][z][j] != 1) continue;
        for (int r = 0; r < 3; r++)
          if (m[i + 2 * x1[r][0]][z + 2 * x1[r][1]][j + 2 * x1[r][2]] == 1 &&
              m[i + x1[r][0]][z + x1[r][1]][j + x1[r][2]] == 1)
            m2[i + x1[r][0]][z + x1[r][1]][j + x1[r][2]] = 1;
        for (int r = 0; r < 3; r++)
          if (m[i + x[r][0]][z + x[r][1]][j + x[r][2]] == 1) {
            if (m[i + y[r][0][0]][z + y[r][0][1]][j + y[r][0][2]] == 1 &&
                m[i + y[r][1][0]][z + y[r][1][1]][j + y[r][1][2]] == 0)
              m2[i + y[r][0][0]][z + y[r][0][1]][j + y[r][0][2]] = 1;
            if (m[i + y[r][0][0]][z + y[r][0][1]][j + y[r][0][2]] == 0 &&
                m[i + y[r][1][0]][z + y[r][1][1]][j + y[r][1][2]] == 1)
              m2[i + y[r][1][0]][z + y[r][1][1]][j + y[r][1][2]] = 1;
          }
      }
  int res = 0;
  for (int i = 1; i <= a; i++)
    for (int z = 1; z <= b; z++)
      for (int j = 1; j <= c; j++) res += m2[i][z][j];
  printf("%d", res);
  return 0;
}
