#include <bits/stdc++.h>
using namespace std;
inline long long IN() {
  long long x = 0;
  int ch = getchar(), f = 1;
  while (!isdigit(ch) && (ch != '-') && (ch != EOF)) ch = getchar();
  if (ch == '-') {
    f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void OUT(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10)
    OUT(x / 10), putchar(x % 10 + '0');
  else
    putchar(x + '0');
}
const int N = 105;
char s[N][N][N];
int n, m, p, Ans;
int main() {
  n = IN(), m = IN(), p = IN();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) scanf("%s", s[i][j] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      for (int k = 1; k <= p; k++) {
        if (s[i][j][k] == '0') continue;
        bool f = 0;
        if (i != 1 && s[i - 1][j][k] == '1') {
          if (i != n && s[i + 1][j][k] == '1') f = 1;
          if (j != m && s[i][j + 1][k] == '1' && s[i - 1][j + 1][k] == '0')
            f = 1;
          if (k != p && s[i][j][k + 1] == '1' && s[i - 1][j][k + 1] == '0')
            f = 1;
        }
        if (j != 1 && s[i][j - 1][k] == '1') {
          if (i != n && s[i + 1][j][k] == '1' && s[i + 1][j - 1][k] == '0')
            f = 1;
          if (j != m && s[i][j + 1][k] == '1') f = 1;
          if (k != p && s[i][j][k + 1] == '1' && s[i][j - 1][k + 1] == '0')
            f = 1;
        }
        if (k != 1 && s[i][j][k - 1] == '1') {
          if (i != n && s[i + 1][j][k] == '1' && s[i + 1][j][k - 1] == '0')
            f = 1;
          if (j != m && s[i][j + 1][k] == '1' && s[i][j + 1][k - 1] == '0')
            f = 1;
          if (k != p && s[i][j][k + 1] == '1') f = 1;
        }
        if (f) Ans++;
      }
  OUT(Ans);
}
