#include <bits/stdc++.h>
using namespace std;
int readint() {
  int x;
  cin >> x;
  return x;
}
long long readll() {
  long long x;
  cin >> x;
  return x;
}
bool is_adequate(int x, int y, int z, int n, int m, int k) {
  return (x >= 0 && y >= 0 && z >= 0 && x < n && y < m && z < k);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n = readint();
  int m = readint();
  int k = readint();
  vector<vector<vector<bool> > > grid(
      n, vector<vector<bool> >(m, vector<bool>(k, false)));
  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) {
        if (s[z] == '1') {
          grid[x][y][z] = true;
        }
      }
    }
  }
  int counter = 0;
  for (int x = 0; x < n; ++x) {
    for (int y = 0; y < m; ++y) {
      for (int z = 0; z < k; ++z) {
        if (!grid[x][y][z]) {
          continue;
        }
        bool flag = false;
        for (int i = 0; i < 3; ++i) {
          int xp = x;
          int yp = y;
          int zp = z;
          if (i == 0) {
            xp -= 1;
          }
          if (i == 1) {
            yp -= 1;
          }
          if (i == 2) {
            zp -= 1;
          }
          if (!is_adequate(xp, yp, zp, n, m, k)) {
            continue;
          }
          if (!grid[xp][yp][zp]) {
            continue;
          }
          for (int j = 0; j < 3; ++j) {
            int xn = x;
            int yn = y;
            int zn = z;
            if (j == 0) {
              xn += 1;
            }
            if (j == 1) {
              yn += 1;
            }
            if (j == 2) {
              zn += 1;
            }
            if (!is_adequate(xn, yn, zn, n, m, k)) {
              continue;
            }
            if (!grid[xn][yn][zn]) {
              continue;
            }
            int xa = xn + xp - x;
            int ya = yn + yp - y;
            int za = zn + zp - z;
            if (!grid[xa][ya][za] || (xa == x && ya == y && za == z)) {
              flag = true;
            }
          }
        }
        if (flag) ++counter;
      }
    }
  }
  cout << counter << "\n";
  return 0;
}
