#include <bits/stdc++.h>
using namespace std;
int mp[102][102][102];
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;
      for (int t = 1; t <= s.size(); ++t) {
        if (s[t - 1] == '1')
          mp[i][j][t] = 1;
        else
          mp[i][j][t] = 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)
        if (mp[i][j][t]) {
          if (mp[i - 1][j][t] && mp[i + 1][j][t])
            ++ans;
          else if (mp[i][j - 1][t] && mp[i][j + 1][t])
            ++ans;
          else if (mp[i][j][t - 1] && mp[i][j][t + 1])
            ++ans;
          else if (mp[i - 1][j][t] && mp[i][j + 1][t] && !mp[i - 1][j + 1][t])
            ++ans;
          else if (mp[i - 1][j][t] && mp[i][j][t + 1] && !mp[i - 1][j][t + 1])
            ++ans;
          else if (mp[i][j - 1][t] && mp[i + 1][j][t] && !mp[i + 1][j - 1][t])
            ++ans;
          else if (mp[i][j - 1][t] && mp[i][j][t + 1] && !mp[i][j - 1][t + 1])
            ++ans;
          else if (mp[i][j][t - 1] && mp[i + 1][j][t] && !mp[i + 1][j][t - 1])
            ++ans;
          else if (mp[i][j][t - 1] && mp[i][j + 1][t] && !mp[i][j + 1][t - 1])
            ++ans;
        }
  cout << ans << endl;
  return 0;
}
