#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  string s;
  vector<vector<vector<bool>>> pc(
      n + 2, vector<vector<bool>>(m + 2, vector<bool>(k + 2)));
  for (int x = 0; x < n; ++x) {
    for (int y = 0; y < m; ++y) {
      cin >> s;
      for (int z = 0; z < k; ++z) {
        pc[x + 1][y + 1][z + 1] = ('1' == s[z]) ? true : false;
      }
    }
    cin.ignore();
  }
  int ans = 0;
  for (int x = 1; x <= n; ++x) {
    for (int y = 1; y <= m; ++y) {
      for (int z = 1; z <= k; ++z) {
        if (pc[x][y][z] &&
            (pc[x - 1][y][z] &&
                 (pc[x + 1][y][z] || pc[x][y][z + 1] && !pc[x - 1][y][z + 1] ||
                  pc[x][y + 1][z] && !pc[x - 1][y + 1][z]) ||
             pc[x][y - 1][z] &&
                 (pc[x][y + 1][z] || pc[x][y][z + 1] && !pc[x][y - 1][z + 1] ||
                  pc[x + 1][y][z] && !pc[x + 1][y - 1][z]) ||
             pc[x][y][z - 1] &&
                 (pc[x][y][z + 1] || pc[x][y + 1][z] && !pc[x][y + 1][z - 1] ||
                  pc[x + 1][y][z] && !pc[x + 1][y][z - 1]))) {
          ++ans;
        }
      }
    }
  }
  cout << ans;
  return 0;
}
