#include <bits/stdc++.h>
char mas[110][110][110];
int main() {
  int n, m, k, i, j, q;
  int ans = 0;
  char ch;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 1; i <= n; i++) {
    scanf("\n");
    for (j = 1; j <= m; j++) {
      for (q = 1; q <= k; q++) scanf("%c", &mas[i][j][q]);
      if (j != m) scanf("\n");
    }
  }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      for (q = 1; q <= k; q++) {
        if (mas[i][j][q] == '0')
          ans += 0;
        else if (i == 1 && j == 1 && q == 1)
          ans += 0;
        else if (i == n && j == m && q == k)
          ans += 0;
        else {
          if (mas[i][j][q - 1] == '1' && mas[i][j][q + 1] == '1')
            ans++;
          else if (mas[i][j - 1][q] == '1' && mas[i][j + 1][q] == '1')
            ans++;
          else if (mas[i - 1][j][q] == '1' && mas[i + 1][j][q] == '1')
            ans++;
          else if (mas[i][j][q - 1] == '1' && mas[i][j + 1][q] == '1' &&
                   mas[i][j + 1][q - 1] == '0')
            ans++;
          else if (mas[i][j - 1][q] == '1' && mas[i][j][q + 1] == '1' &&
                   mas[i][j - 1][q + 1] == '0')
            ans++;
          else if (mas[i][j - 1][q] == '1' && mas[i + 1][j][q] == '1' &&
                   mas[i + 1][j - 1][q] == '0')
            ans++;
          else if (mas[i][j + 1][q] == '1' && mas[i - 1][j][q] == '1' &&
                   mas[i - 1][j + 1][q] == '0')
            ans++;
          else if (mas[i][j][q - 1] == '1' && mas[i + 1][j][q] == '1' &&
                   mas[i + 1][j][q - 1] == '0')
            ans++;
          else if (mas[i][j][q + 1] == '1' && mas[i - 1][j][q] == '1' &&
                   mas[i - 1][j][q + 1] == '0')
            ans++;
        }
      }
  printf("%d\n", ans);
  return 0;
}
