#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int arr[n + 2][m + 2][k + 2];
  for (int i = 1; i < n + 1; ++i) {
    for (int j = 1; j < m + 1; ++j) {
      for (int z = 1; z < k + 1; ++z) {
        char c;
        cin >> c;
        int cc = c - '0';
        arr[i][j][z] = cc;
      }
    }
  }
  for (int i = 0; i < n + 2; ++i) {
    for (int j = 0; j < m + 2; ++j) {
      arr[i][j][0] = 0;
      arr[i][j][k + 1] = 0;
    }
  }
  for (int i = 0; i < n + 2; ++i) {
    for (int z = 0; z < k + 2; ++z) {
      arr[i][0][z] = 0;
      arr[i][m + 1][z] = 0;
    }
  }
  for (int j = 0; j < m + 2; ++j) {
    for (int z = 0; z < k + 2; ++z) {
      arr[0][j][z] = 0;
      arr[n + 1][j][z] = 0;
    }
  }
  int ans = 0;
  for (int i = 1; i < n + 1; ++i) {
    for (int j = 1; j < m + 1; ++j) {
      for (int z = 1; z < k + 1; ++z) {
        if (arr[i][j][z]) {
          if ((arr[i - 1][j][z]) &&
                  (arr[i + 1][j][z] ||
                   arr[i][j][z + 1] && !arr[i - 1][j][z + 1] ||
                   arr[i][j + 1][z] && !arr[i - 1][j + 1][z]) ||
              (arr[i][j - 1][z]) &&
                  (arr[i][j + 1][z] ||
                   arr[i + 1][j][z] && !arr[i + 1][j - 1][z] ||
                   arr[i][j][z + 1] && !arr[i][j - 1][z + 1]) ||
              (arr[i][j][z - 1]) &&
                  (arr[i][j][z + 1] ||
                   arr[i + 1][j][z] && !arr[i + 1][j][z - 1] ||
                   arr[i][j + 1][z] && !arr[i][j + 1][z - 1])) {
            ++ans;
          }
        }
      }
    }
  }
  cout << ans;
}
