#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 2e9 + 1;
const double eps = 1e-9;
const int N = 1e2 + 5;
int n, m, k;
string s;
int mm[N][N][N];
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      cin >> s;
      if (s == "") cin >> s;
      for (int t = 1; t <= k; ++t) {
        mm[i][j][t] = s[t - 1] - '0';
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      for (int t = 1; t <= k; ++t) {
        bool fl1 = (mm[i + 1][j][t] && mm[i][j][t]);
        bool fl2 = (mm[i][j + 1][t] && mm[i][j][t]);
        bool fl3 = (mm[i][j][t + 1] && mm[i][j][t]);
        int flag = 0;
        if (mm[i - 1][j][t]) {
          if (fl1) flag = true;
          if (fl2 && !mm[i - 1][j + 1][t]) flag = true;
          if (fl3 && !mm[i - 1][j][t + 1]) flag = true;
        }
        if (mm[i][j - 1][t]) {
          if (fl1 && !mm[i + 1][j - 1][t]) flag = true;
          if (fl2) flag = true;
          if (fl3 && !mm[i][j - 1][t + 1]) flag = true;
        }
        if (mm[i][j][t - 1]) {
          if (fl1 && !mm[i + 1][j][t - 1]) flag = true;
          if (fl2 && !mm[i][j + 1][t - 1]) flag = true;
          if (fl3) flag = true;
        }
        ans += flag;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
