#include <bits/stdc++.h>
bool a[102][102][102];
long n, m, k;
int main() {
  std::cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      for (int p = 1; p <= k; ++p)
        if (i > 0 && i <= n && j > 0 && j <= m && p > 0 && p <= k) {
          char c;
          std::cin >> c;
          a[i][j][p] = c == '1';
        } else
          a[i][j][p] = false;
  int critical = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      for (int p = 1; p <= k; ++p) {
        bool cr = false;
        if (a[i][j][p]) {
          if (a[i - 1][j][p]) {
            if (a[i + 1][j][p] || (a[i][j + 1][p] && !a[i - 1][j + 1][p]) ||
                (a[i][j][p + 1] && !a[i - 1][j][p + 1]))
              cr = true;
          }
          if (a[i][j - 1][p]) {
            if ((a[i + 1][j][p] && !(a[i + 1][j - 1][p])) || (a[i][j + 1][p]) ||
                (a[i][j][p + 1] && !a[i][j - 1][p + 1]))
              cr = true;
          }
          if (a[i][j][p - 1]) {
            if ((a[i + 1][j][p] && !a[i + 1][j][p - 1]) ||
                (a[i][j + 1][p] && !a[i][j + 1][p - 1]) || (a[i][j][p + 1]))
              cr = true;
          }
        }
        if (cr) ++critical;
      }
  std::cout << critical << std::endl;
  return 0;
}
