#include <bits/stdc++.h>
using namespace std;
char a[104][104][104];
int px[104][104][104], py[104][104][104], pz[104][104][104], kol[104][104][104];
bool use[104][104][104];
vector<int> x, y, z;
void get_ans(int i, int j, int p);
int main() {
  int n, m, k, i, j, p, t, ans = 0;
  cin >> n >> m >> k;
  for (i = 1; i <= n; i++) {
    if (i > 1) scanf("\n");
    for (j = 1; j <= m; j++) {
      scanf("\n");
      for (p = 1; p <= k; p++) {
        scanf("%c", &a[i][j][p]);
      }
    }
  }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      for (p = 1; p <= k; p++)
        if (a[i][j][p] == '1') {
          x.clear();
          y.clear();
          z.clear();
          if (a[i + 1][j][p] == '1') get_ans(i + 1, j, p);
          if (a[i][j + 1][p] == '1') get_ans(i, j + 1, p);
          if (a[i][j][p + 1] == '1') get_ans(i, j, p + 1);
          for (t = 0; t < x.size(); t++) {
            if (kol[x[t]][y[t]][z[t]] == 1)
              use[px[x[t]][y[t]][z[t]]][py[x[t]][y[t]][z[t]]]
                 [pz[x[t]][y[t]][z[t]]] = 1;
            kol[x[t]][y[t]][z[t]] = 0;
          }
        }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      for (p = 1; p <= k; p++)
        if (use[i][j][p]) ans++;
  cout << ans << endl;
  return 0;
}
void get_ans(int i, int j, int p) {
  if (a[i + 1][j][p] == '1') {
    x.push_back(i + 1);
    y.push_back(j);
    z.push_back(p);
    px[i + 1][j][p] = i;
    py[i + 1][j][p] = j;
    pz[i + 1][j][p] = p;
    kol[i + 1][j][p]++;
  }
  if (a[i][j + 1][p] == '1') {
    x.push_back(i);
    y.push_back(j + 1);
    z.push_back(p);
    px[i][j + 1][p] = i;
    py[i][j + 1][p] = j;
    pz[i][j + 1][p] = p;
    kol[i][j + 1][p]++;
  }
  if (a[i][j][p + 1] == '1') {
    x.push_back(i);
    y.push_back(j);
    z.push_back(p + 1);
    px[i][j][p + 1] = i;
    py[i][j][p + 1] = j;
    pz[i][j][p + 1] = p;
    kol[i][j][p + 1]++;
  }
}
