#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100 + 5;
int n, m, r;
bool mat[MAX_N][MAX_N][MAX_N];
bool is_crit[MAX_N][MAX_N][MAX_N];
struct point {
  explicit point(int x = 0, int y = 0, int z = 0) : x(x), y(y), z(z) {}
  int x, y, z;
};
point operator+(point first, const point &second) {
  first.x += second.x;
  first.y += second.y;
  first.z += second.z;
  return first;
}
void read() {
  cin >> n >> m >> r;
  string str;
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (m); ++j) {
      cin >> str;
      for (int t = 0; t < (r); ++t) {
        mat[i][j][t] = (str[t] == '1');
      }
    }
  }
}
bool get(int i, int j, int k) {
  if (i >= 0 && i < n && j >= 0 && j < m && k >= 0 && k < r) {
    return mat[i][j][k];
  } else {
    return false;
  }
}
bool get(const point &p) { return get(p.x, p.y, p.z); }
bool apply(const point &start, const vector<point> &m) {
  bool res = get(start);
  for (const point &p : m) {
    point next = start + p;
    res = res && get(next);
  }
  return res;
}
vector<point> on_line[3];
vector<vector<vector<point>>> on_corner;
void init() {
  on_line[0] = {point{1, 0, 0}, point{2, 0, 0}};
  on_line[1] = {point{0, 1, 0}, point{0, 2, 0}};
  on_line[2] = {point{0, 0, 1}, point{0, 0, 2}};
  on_corner = {
      {{point(1, 0, 0), point(1, 1, 0)}, {point(0, 1, 0), point(1, 1, 0)}},
      {{point(1, 0, 0), point(1, 0, 1)}, {point(0, 0, 1), point(1, 0, 1)}},
      {{point(0, 1, 0), point(0, 1, 1)}, {point(0, 0, 1), point(0, 1, 1)}}};
}
void set_crit(const point &p) { is_crit[p.x][p.y][p.z] = true; }
void solve_lines(const point &p) {
  for (int i = 0; i < (3); ++i) {
    if (apply(p, on_line[i])) {
      set_crit(p + on_line[i][0]);
    }
  }
}
void solve_corners(const point &p) {
  for (int i = 0; i < (3); ++i) {
    bool first = apply(p, on_corner[i][0]);
    bool second = apply(p, on_corner[i][1]);
    if (first && !second) {
      set_crit(p + on_corner[i][0][0]);
    }
    if (second && !first) {
      set_crit(p + on_corner[i][1][0]);
    }
  }
}
int solve() {
  for (int i = 0; i < (n); ++i)
    for (int j = 0; j < (m); ++j)
      for (int k = 0; k < (r); ++k) {
        point p(i, j, k);
        solve_lines(p);
        solve_corners(p);
      }
  int ans = 0;
  for (int i = 0; i < (n); ++i)
    for (int j = 0; j < (m); ++j)
      for (int k = 0; k < (r); ++k) {
        ans += (is_crit[i][j][k] ? 1 : 0);
      }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  init();
  read();
  cout << solve() << endl;
  return 0;
}
