#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
struct Sync_stdio {
  Sync_stdio() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} _sync_stdio;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<vector<vector<int>>> v(n + 2,
                                vector<vector<int>>(m + 2, vector<int>(k + 2)));
  vector<vector<vector<int>>> ans(
      n + 2, vector<vector<int>>(m + 2, vector<int>(k + 2)));
  for (int i = (0); i < (n); ++i) {
    for (int j = (0); j < (m); ++j) {
      string s;
      cin >> s;
      for (int l = (0); l < (k); ++l) {
        v[i + 1][j + 1][l + 1] = s[l] - '0';
      }
    }
  }
  for (int i = (1); i < (n + 1); ++i) {
    for (int j = (1); j < (m + 1); ++j) {
      for (int l = (1); l < (k + 1); ++l) {
        if (v[i][j][l] == 1 && v[i - 1][j][l] == 1 && v[i + 1][j][l] == 1) {
          ans[i][j][l] = 1;
        }
        if (v[i][j][l] == 1 && v[i][j - 1][l] == 1 && v[i][j + 1][l] == 1) {
          ans[i][j][l] = 1;
        }
        if (v[i][j][l] == 1 && v[i][j][l - 1] == 1 && v[i][j][l + 1] == 1) {
          ans[i][j][l] = 1;
        }
        for (int x1 = (0); x1 < (3); ++x1) {
          for (int x2 = (0); x2 < (3); ++x2) {
            if (x1 == x2) {
              continue;
            }
            vector<int> dx1(3);
            vector<int> dx2(3);
            ++dx1[x1];
            ++dx2[x2];
            if (v[i][j][l] == 1 && v[i - dx1[0]][j - dx1[1]][l - dx1[2]] == 1 &&
                v[i + dx2[0]][j + dx2[1]][l + dx2[2]] == 1 &&
                v[i - dx1[0] + dx2[0]][j - dx1[1] + dx2[1]]
                 [l - dx1[2] + dx2[2]] == 0) {
              ans[i][j][l] = 1;
            }
          }
        }
      }
    }
  }
  int res = 0;
  for (int i = (1); i < (n + 1); ++i) {
    for (int j = (1); j < (m + 1); ++j) {
      for (int l = (1); l < (k + 1); ++l) {
        res += ans[i][j][l];
      }
    }
  }
  cout << res;
}
