#include <bits/stdc++.h>
using namespace std;
const int maxa = 110, maxn = 1e6 + 100;
vector<int> adj1[maxn], adj2[maxn];
char a[maxa][maxa][maxa];
int N, M, K;
int get(int i, int j, int k) { return i * M * K + j * K + k; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> N >> M >> K;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < M; j++)
      for (int k = 0; k < K; k++) cin >> a[i][j][k];
  int n = N * M * K;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < M; j++)
      for (int k = 0; k < K; k++)
        if (a[i][j][k] == '1') {
          int v = get(i, j, k), u;
          if (i + 1 < N && a[i + 1][j][k] == '1') {
            int u = get(i + 1, j, k);
            adj1[v].push_back(u);
            adj2[u].push_back(v);
          }
          if (j + 1 < M && a[i][j + 1][k] == '1') {
            int u = get(i, j + 1, k);
            adj1[v].push_back(u);
            adj2[u].push_back(v);
          }
          if (k + 1 < K && a[i][j][k + 1] == '1') {
            int u = get(i, j, k + 1);
            adj1[v].push_back(u);
            adj2[u].push_back(v);
          }
        }
  int ans = 0;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < M; j++)
      for (int k = 0; k < K; k++)
        if (a[i][j][k] == '1') {
          int v = get(i, j, k);
          bool okay = false;
          for (auto u : adj2[v]) {
            set<int> s;
            for (auto w : adj1[u])
              if (v != w)
                for (auto p : adj1[w]) s.insert(p);
            for (auto w : adj1[v])
              if (s.find(w) == s.end()) okay = true;
          }
          ans += okay;
        }
  cout << ans << endl;
  return 0;
}
