#include <bits/stdc++.h>
using namespace std;
int mat[111][111][111];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      string s;
      cin >> s;
      s = "0" + s;
      for (int x = 1; x <= k; x++) {
        if (s[x] == '1') {
          mat[i][j][x] = 1;
        } else {
          mat[i][j][x] = 0;
        }
      }
    }
  }
  int kol = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int x = 1; x <= k; x++) {
        if (mat[i][j][x] == 0) {
          continue;
        }
        if (mat[i - 1][j][x] == 0 && mat[i][j - 1][x] == 0 &&
            mat[i][j][x - 1] == 0) {
          continue;
        }
        if (mat[i + 1][j][x] == 0 && mat[i][j + 1][x] == 0 &&
            mat[i][j][x + 1] == 0) {
          continue;
        }
        if (mat[i - 1][j][x] == 1 && mat[i + 1][j][x] == 1) {
          kol++;
          continue;
        }
        if (mat[i][j - 1][x] == 1 && mat[i][j + 1][x] == 1) {
          kol++;
          continue;
        }
        if (mat[i][j][x - 1] == 1 && mat[i][j][x + 1] == 1) {
          kol++;
          continue;
        }
        if (mat[i - 1][j][x] == 1 && mat[i][j + 1][x] == 1 &&
            mat[i - 1][j + 1][x] == 0) {
          kol++;
          continue;
        }
        if (mat[i - 1][j][x] == 1 && mat[i][j][x + 1] == 1 &&
            mat[i - 1][j][x + 1] == 0) {
          kol++;
          continue;
        }
        if (mat[i][j - 1][x] == 1 && mat[i + 1][j][x] == 1 &&
            mat[i + 1][j - 1][x] == 0) {
          kol++;
          continue;
        }
        if (mat[i][j - 1][x] == 1 && mat[i][j][x + 1] == 1 &&
            mat[i][j - 1][x + 1] == 0) {
          kol++;
          continue;
        }
        if (mat[i][j][x - 1] == 1 && mat[i + 1][j][x] == 1 &&
            mat[i + 1][j][x - 1] == 0) {
          kol++;
          continue;
        }
        if (mat[i][j][x - 1] == 1 && mat[i][j + 1][x] == 1 &&
            mat[i][j + 1][x - 1] == 0) {
          kol++;
          continue;
        }
      }
    }
  }
  cout << kol;
  return 0;
}
