#include <bits/stdc++.h>
using namespace std;
const int maxl = 128;
const int X[3] = {+1, +0, +0};
const int Y[3] = {+0, +1, +0};
const int Z[3] = {+0, +0, +1};
int n, m, k;
string s[maxl][maxl];
int ans;
int dis(int a, int b, int c, int d, int e, int f) {
  return abs(a - d) + abs(b - e) + abs(c - f);
}
int count(int a, int b, int c, int d, int e, int f) {
  if (a < 0 or b < 0 or c < 0 or n <= d or k <= e or m <= f) return 0;
  if (s[a][b][c] == '0' or s[d][e][f] == '0') return 0;
  int ret = 0;
  for (int i = 0; i < 3; i++)
    if (dis(a + X[i], b + Y[i], c + Z[i], d, e, f) == 1 and
        s[a + X[i]][b + Y[i]][c + Z[i]] == '1')
      ret++;
  return ret;
}
int check(int x, int y, int z) {
  if (s[x][y][z] == '0') return false;
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++)
      if (count(x - X[i], y - Y[i], z - Z[i], x + X[j], y + Y[j], z + Z[j]) ==
          1)
        return 1;
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < k; j++) cin >> s[i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < k; j++)
      for (int l = 0; l < m; l++) ans += check(i, j, l);
  cout << ans << endl;
  return 0;
}
