#include <bits/stdc++.h>
using namespace std;
char a[111][111][111];
int ans, n, m, k;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++)
      for (int c = 1; c <= k; c++) {
        cin >> a[i][j][c];
        a[i][j][c] -= '0';
      }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++)
      for (int c = 1; c <= k; c++)
        if (a[i][j][c]) {
          bool f = 0;
          if (a[i - 1][j][c] && a[i + 1][j][c]) f = 1;
          if (a[i][j - 1][c] && a[i][j + 1][c]) f = 1;
          if (a[i][j][c - 1] && a[i][j][c + 1]) f = 1;
          if (a[i][j - 1][c] && a[i][j][c + 1] && !a[i][j - 1][c + 1]) f = 1;
          if (a[i][j][c - 1] && a[i][j + 1][c] && !a[i][j + 1][c - 1]) f = 1;
          if (a[i - 1][j][c] && a[i][j][c + 1] && !a[i - 1][j][c + 1]) f = 1;
          if (a[i - 1][j][c] && a[i][j + 1][c] && !a[i - 1][j + 1][c]) f = 1;
          if (a[i][j - 1][c] && a[i + 1][j][c] && !a[i + 1][j - 1][c]) f = 1;
          if (a[i][j][c - 1] && a[i + 1][j][c] && !a[i + 1][j][c - 1]) f = 1;
          ans += f;
        }
  }
  cout << ans;
}
