#include <bits/stdc++.h>
using namespace std;
int n, m, k;
bool check(int n1, int m1, int k1) {
  return n1 >= 0 && n1 < n && m1 >= 0 && m1 < m && k1 >= 0 && k1 < k;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> k;
  vector<vector<vector<char>>> a(n, vector<vector<char>>(m, vector<char>(k)));
  for (int i = (0); i < (n); i++)
    for (int j = (0); j < (m); j++)
      for (int k1 = (0); k1 < (k); k1++) {
        cin >> a[i][j][k1];
        a[i][j][k1] -= 48;
      }
  int res = 0;
  for (int i = (0); i < (n); i++)
    for (int j = (0); j < (m); j++)
      for (int k1 = (0); k1 < (k); k1++)
        if (a[i][j][k1] != 0) {
          if (check(i - 1, j, k1) && check(i + 1, j, k1) &&
              a[i - 1][j][k1] == a[i + 1][j][k1] && a[i - 1][j][k1] == 1) {
            res++;
            continue;
          }
          if (check(i, j - 1, k1) && check(i, j + 1, k1) &&
              a[i][j - 1][k1] == a[i][j + 1][k1] && a[i][j - 1][k1] == 1) {
            res++;
            continue;
          }
          if (check(i, j, k1 - 1) && check(i, j, k1 + 1) &&
              a[i][j][k1 - 1] == a[i][j][k1 + 1] && a[i][j][k1 - 1] == 1) {
            res++;
            continue;
          }
          if (check(i, j + 1, k1 - 1) && a[i][j][k1 - 1] == a[i][j + 1][k1] &&
              a[i][j + 1][k1] == 1 && a[i][j + 1][k1 - 1] == 0) {
            res++;
            continue;
          }
          if (check(i, j - 1, k1 + 1) && a[i][j - 1][k1] == a[i][j][k1 + 1] &&
              a[i][j][k1 + 1] == 1 && a[i][j - 1][k1 + 1] == 0) {
            res++;
            continue;
          }
          if (check(i + 1, j, k1 - 1) && a[i][j][k1 - 1] == a[i + 1][j][k1] &&
              a[i + 1][j][k1] == 1 && a[i + 1][j][k1 - 1] == 0) {
            res++;
            continue;
          }
          if (check(i - 1, j, k1 + 1) && a[i - 1][j][k1] == a[i][j][k1 + 1] &&
              a[i][j][k1 + 1] == 1 && a[i - 1][j][k1 + 1] == 0) {
            res++;
            continue;
          }
          if (check(i + 1, j - 1, k1) && a[i][j - 1][k1] == a[i + 1][j][k1] &&
              a[i + 1][j][k1] == 1 && a[i + 1][j - 1][k1] == 0) {
            res++;
            continue;
          }
          if (check(i - 1, j + 1, k1) && a[i - 1][j][k1] == a[i][j + 1][k1] &&
              a[i][j + 1][k1] == 1 && a[i - 1][j + 1][k1] == 0) {
            res++;
            continue;
          }
        }
  cout << res << '\n';
  return 0;
}
