#include <bits/stdc++.h>
using namespace std;
int mas[102][102][102], res;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m, k;
  char c;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      for (int g = 1; g <= k; g++) cin >> c, mas[i][j][g] = (c == '1');
  for (int x = 1; x <= n; x++)
    for (int y = 1; y <= m; y++)
      for (int z = 1; z <= k; z++)
        if (mas[x][y][z]) {
          if (mas[x - 1][y][z] && mas[x + 1][y][z] ||
              mas[x][y - 1][z] && mas[x][y + 1][z] ||
              mas[x][y][z - 1] && mas[x][y][z + 1] ||
              mas[x - 1][y][z] && mas[x][y + 1][z] && !mas[x - 1][y + 1][z] ||
              mas[x][y - 1][z] && mas[x + 1][y][z] && !mas[x + 1][y - 1][z] ||
              mas[x - 1][y][z] && mas[x][y][z + 1] && !mas[x - 1][y][z + 1] ||
              mas[x][y][z - 1] && mas[x + 1][y][z] && !mas[x + 1][y][z - 1] ||
              mas[x][y][z - 1] && mas[x][y + 1][z] && !mas[x][y + 1][z - 1] ||
              mas[x][y - 1][z] && mas[x][y][z + 1] && !mas[x][y - 1][z + 1])
            res++;
        }
  cout << res << "\n";
  return 0;
}
