#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<vector<int> > > v(n,
                                  vector<vector<int> >(m, vector<int>(k, 0)));
  for (int x = 0; x < n; ++x)
    for (int y = 0; y < m; ++y) {
      string s;
      cin >> s;
      for (int z = 0; z < k; ++z) v[x][y][z] = s[z] - '0';
    }
  long long res = 0;
  for (int x = 0; x < n; ++x)
    for (int y = 0; y < m; ++y)
      for (int z = 0; z < k; ++z) {
        if (!v[x][y][z]) continue;
        if (x != 0) {
          if (x != n - 1) {
            if (v[x - 1][y][z] & v[x + 1][y][z]) {
              res++;
              continue;
            }
          }
          if (y != m - 1) {
            if (v[x - 1][y][z] & v[x][y + 1][z] & !v[x - 1][y + 1][z]) {
              res++;
              continue;
            }
          }
          if (z != k - 1) {
            if (v[x - 1][y][z] & v[x][y][z + 1] & !v[x - 1][y][z + 1]) {
              res++;
              continue;
            }
          }
        }
        if (y != 0) {
          if (y != m - 1) {
            if (v[x][y - 1][z] & v[x][y + 1][z]) {
              res++;
              continue;
            }
          }
          if (x != n - 1) {
            if (v[x][y - 1][z] & v[x + 1][y][z] & !v[x + 1][y - 1][z]) {
              res++;
              continue;
            }
          }
          if (z != k - 1) {
            if (v[x][y - 1][z] & v[x][y][z + 1] & !v[x][y - 1][z + 1]) {
              res++;
              continue;
            }
          }
        }
        if (z != 0) {
          if (z != k - 1) {
            if (v[x][y][z - 1] & v[x][y][z + 1]) {
              res++;
              continue;
            }
          }
          if (y != m - 1) {
            if (v[x][y][z - 1] & v[x][y + 1][z] & !v[x][y + 1][z - 1]) {
              res++;
              continue;
            }
          }
          if (x != n - 1) {
            if (v[x][y][z - 1] & v[x + 1][y][z] & !v[x + 1][y][z - 1]) {
              res++;
              continue;
            }
          }
        }
      }
  cout << res;
  return 0;
}
