#include <bits/stdc++.h>
using namespace std;
char c[110][110][110];
bool a[110][110][110];
bool b[110][110][110];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf("%s", c[i][j]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      for (int s = 0; s < k; s++)
        if (c[i][j][s] == '1') a[i + 1][j + 1][s + 1] = true;
  int di[3] = {1, 0, 0};
  int dj[3] = {0, 1, 0};
  int ds[3] = {0, 0, 1};
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      for (int s = 1; s <= k; s++) {
        if (!a[i][j][s]) continue;
        for (int p = 0; p < 3; p++) {
          if (a[i + di[p]][j + dj[p]][s + ds[p]] &&
              a[i - di[p]][j - dj[p]][s - ds[p]]) {
            b[i][j][s] = true;
          }
        }
        for (int p = 0; p < 3; p++)
          for (int l = 0; l < 3; l++)
            if (a[i - di[p]][j - dj[p]][s - ds[p]] &&
                a[i + di[l]][j + dj[l]][s + ds[l]] &&
                !a[i - di[p] + di[l]][j - dj[p] + dj[l]][s - ds[p] + ds[l]]) {
              b[i][j][s] = true;
            }
      }
  int answ = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int s = 1; s <= k; s++) {
        if (b[i][j][s]) answ++;
      }
    }
  }
  cout << answ << endl;
  return 0;
}
