#include <bits/stdc++.h>
const int N = 105;
int n, m, k;
char a[N][N][N];
bool Check(int i, int j, int l) {
  if ((a[i - 1][j][l] == '1') && (a[i + 1][j][l] == '1')) return true;
  if ((a[i][j - 1][l] == '1') && (a[i][j + 1][l] == '1')) return true;
  if ((a[i][j][l - 1] == '1') && (a[i][j][l + 1] == '1')) return true;
  if ((a[i - 1][j][l] == '1') && (a[i][j + 1][l] == '1') &&
      !(a[i - 1][j + 1][l] == '1'))
    return true;
  if ((a[i - 1][j][l] == '1') && (a[i][j][l + 1] == '1') &&
      !(a[i - 1][j][l + 1] == '1'))
    return true;
  if ((a[i][j - 1][l] == '1') && (a[i + 1][j][l] == '1') &&
      !(a[i + 1][j - 1][l] == '1'))
    return true;
  if ((a[i][j - 1][l] == '1') && (a[i][j][l + 1] == '1') &&
      !(a[i][j - 1][l + 1] == '1'))
    return true;
  if ((a[i][j][l - 1] == '1') && (a[i + 1][j][l] == '1') &&
      !(a[i + 1][j][l - 1] == '1'))
    return true;
  if ((a[i][j][l - 1] == '1') && (a[i][j + 1][l] == '1') &&
      !(a[i][j + 1][l - 1] == '1'))
    return true;
  return false;
}
void Solve() {
  int res = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      for (int l = 1; l <= k; ++l)
        if (a[i][j][l] == '1') res += Check(i, j, l);
  printf("%d", res);
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) scanf("%s", a[i][j] + 1);
  Solve();
  return 0;
}
