#include <bits/stdc++.h>
using namespace std;
struct trio {
  int x, y, z;
  trio() {}
  trio(int x, int y, int z) : x(x), y(y), z(z) {}
};
inline bool operator<(trio t1, trio t2) {
  return t1.x < t2.x || (t1.x == t2.x && t1.y < t2.y) ||
         (t1.x == t2.x && t1.y == t2.y && t1.z < t2.z);
}
inline bool operator==(trio t1, trio t2) {
  return t1.x == t2.x && t1.y == t1.y && t1.z == t2.z;
}
vector<vector<vector<int>>> comp;
int n, m, k;
int cnt = 0;
inline bool check(int t, int n) { return t == 0 || t == n + 1; }
inline bool is_active(trio t) { return comp[t.x][t.y][t.z] == 1; }
inline bool is_valid(trio t1, trio t2, trio t3) {
  if (!is_active(t1)) return false;
  if (!is_active(t2)) return false;
  if (!is_active(t3)) return false;
  return true;
}
inline bool in_border(trio t) {
  return !check(t.x, n) && !check(t.y, m) && !check(t.z, k);
}
inline void solve(trio t) {
  trio p1 = trio(t.x - 1, t.y, t.z);
  trio p2 = trio(t.x, t.y - 1, t.z);
  trio p3 = trio(t.x, t.y, t.z - 1);
  trio s1 = trio(t.x + 1, t.y, t.z);
  trio s2 = trio(t.x, t.y + 1, t.z);
  trio s3 = trio(t.x, t.y, t.z + 1);
  if (is_valid(p1, t, s1)) {
    cnt++;
    return;
  }
  if (is_valid(p2, t, s2)) {
    cnt++;
    return;
  }
  if (is_valid(p3, t, s3)) {
    cnt++;
    return;
  }
  if (is_valid(p1, t, s2)) {
    trio v = trio(t.x - 1, t.y + 1, t.z);
    if (in_border(v) && !is_active(v)) {
      cnt++;
      return;
    }
  }
  if (is_valid(p1, t, s3)) {
    trio v = trio(t.x - 1, t.y, t.z + 1);
    if (in_border(v) && !is_active(v)) {
      cnt++;
      return;
    }
  }
  if (is_valid(p2, t, s1)) {
    trio v = trio(t.x + 1, t.y - 1, t.z);
    if (in_border(v) && !is_active(v)) {
      cnt++;
      return;
    }
  }
  if (is_valid(p2, t, s3)) {
    trio v = trio(t.x, t.y - 1, t.z + 1);
    if (in_border(v) && !is_active(v)) {
      cnt++;
      return;
    }
  }
  if (is_valid(p3, t, s1)) {
    trio v = trio(t.x + 1, t.y, t.z - 1);
    if (in_border(v) && !is_active(v)) {
      cnt++;
      return;
    }
  }
  if (is_valid(p3, t, s2)) {
    trio v = trio(t.x, t.y + 1, t.z - 1);
    if (in_border(v) && !is_active(v)) {
      cnt++;
      return;
    }
  }
}
int main() {
  char ch;
  queue<trio> q;
  scanf("%d%d%d", &n, &m, &k);
  comp.resize(n + 2);
  for (int i = 0; i <= n + 1; i++) {
    comp[i].resize(m + 2);
    for (int j = 0; j <= m + 1; j++) {
      comp[i][j].resize(k + 2);
      for (int t = 0; t <= k + 1; t++) {
        if (check(i, n) || check(j, m) || check(t, k)) {
          comp[i][j][t] = 0;
          continue;
        }
        cin >> ch;
        comp[i][j][t] = (ch == '0') ? 0 : 1;
      }
    }
    scanf("%c", &ch);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int t = 1; t <= k; t++) {
        solve(trio(i, j, t));
      }
    }
  }
  printf("%d", cnt);
}
