#include <bits/stdc++.h>
using namespace std;
long long const modul = 1;
long long mod_sum(long long x, long long y) { return (x + y) % modul; }
long long mod_sub(long long x, long long y) {
  if (x > y) {
    return (x - y) % modul;
  } else {
    return (modul + x - y) % modul;
  }
}
long long mod_mpl(long long x, long long y) { return (x * y) % modul; }
void set_precise(int n) {
  cout << fixed;
  cout << setprecision(n);
}
int dang[100][100][100];
int comp[100][100][100];
int calc(int x, int y, int z) { return x * 10000 + y * 100 + z; }
void check(int x, int y, int z, int n, int m, int k) {
  if (x + 2 < n) {
    if ((comp[x][y][z]) && (comp[x + 1][y][z]) && (comp[x + 2][y][z])) {
      dang[x + 1][y][z] = 1;
    }
  }
  if (y + 2 < m) {
    if ((comp[x][y][z]) && (comp[x][y + 1][z]) && (comp[x][y + 2][z])) {
      dang[x][y + 1][z] = 1;
    }
  }
  if (z + 2 < k) {
    if ((comp[x][y][z]) && (comp[x][y][z + 1]) && (comp[x][y][z + 2])) {
      dang[x][y][z + 1] = 1;
    }
  }
  if ((x + 1 < n) && (y + 1 < m)) {
    if ((comp[x][y][z]) && (comp[x + 1][y][z] + comp[x][y + 1][z] == 1) &&
        (comp[x + 1][y + 1][z])) {
      if (comp[x + 1][y][z]) {
        dang[x + 1][y][z] = 1;
      } else {
        dang[x][y + 1][z] = 1;
      }
    }
  }
  if ((x + 1 < n) && (z + 1 < k)) {
    if ((comp[x][y][z]) && (comp[x + 1][y][z] + comp[x][y][z + 1] == 1) &&
        (comp[x + 1][y][z + 1])) {
      if (comp[x + 1][y][z]) {
        dang[x + 1][y][z] = 1;
      } else {
        dang[x][y][z + 1] = 1;
      }
    }
  }
  if ((y + 1 < m) && (z + 1 < k)) {
    if ((comp[x][y][z]) && (comp[x][y + 1][z] + comp[x][y][z + 1] == 1) &&
        (comp[x][y + 1][z + 1])) {
      if (comp[x][y + 1][z]) {
        dang[x][y + 1][z] = 1;
      } else {
        dang[x][y][z + 1] = 1;
      }
    }
  }
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      string s;
      cin >> s;
      for (int l = 0; l < k; ++l) {
        char x = s[l] - '0';
        comp[i][j][l] = int(x);
        dang[i][j][l] = 0;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      for (int l = 0; l < k; ++l) {
        int x = i;
        int y = j;
        int z = l;
        check(x, y, z, n, m, k);
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      for (int l = 0; l < k; ++l) {
        if (dang[i][j][l]) {
          ++ans;
        }
      }
    }
  }
  cout << ans;
  return 0;
}
