#include <bits/stdc++.h>
using namespace std;
int a[200][200][200];
int main() {
  for (int i = 0; i < 200; i++)
    for (int j = 0; j < 200; j++)
      for (int k = 0; k < 200; k++) a[i][j][k] = 0;
  int h, n, m;
  scanf("%d %d %d", &h, &n, &m);
  for (int i = 1; i <= h; i++)
    for (int j = 1; j <= n; j++) {
      string s;
      cin >> s;
      for (int k = 1; k <= s.length(); k++) a[i][j][k] = s[k - 1] - '0';
    }
  int kol = 0;
  for (int i = 1; i <= h; i++)
    for (int j = 1; j <= n; j++)
      for (int k = 1; k <= m; k++)
        if (a[i][j][k] &&
            (a[i - 1][j][k] * a[i + 1][j][k] ||
             a[i][j - 1][k] * a[i][j + 1][k] ||
             a[i][j][k - 1] * a[i][j][k + 1] ||
             a[i - 1][j][k] && (a[i][j + 1][k] && !a[i - 1][j + 1][k] ||
                                a[i][j][k + 1] && !a[i - 1][j][k + 1]) ||
             a[i][j - 1][k] && (a[i + 1][j][k] && !a[i + 1][j - 1][k] ||
                                a[i][j][k + 1] && !a[i][j - 1][k + 1]) ||
             a[i][j][k - 1] && (a[i + 1][j][k] && !a[i + 1][j][k - 1] ||
                                a[i][j + 1][k] && !a[i][j + 1][k - 1])))
          kol++;
  printf("%d\n", kol);
  return 0;
}
