#include <bits/stdc++.h>
using namespace std;
int D[120][120][120] = {0}, C[120][120][120];
int main() {
  int n, k, m;
  cin >> n >> m >> k;
  string s;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> s;
      for (int y = 0; y < k; y++) {
        if (s[y] == '0') {
          C[i][j][y] = -1;
        } else {
          C[i][j][y] = 1;
          D[i][j][y] = 1;
        }
      }
      scanf("/n");
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      for (int y = 0; y < k; y++) {
        if (C[i][j][y] == 1) {
          bool ch;
          ch = false;
          if ((i > 0) && (C[i - 1][j][y] == 1)) {
            if ((i + 1 < n) && (C[i + 1][j][y] == 1)) ch = true;
            if ((j + 1 < m) && (C[i - 1][j + 1][y] == -1) &&
                (C[i][j + 1][y] == 1))
              ch = true;
            if ((y + 1 < k) && (C[i - 1][j][y + 1] == -1) &&
                (C[i][j][y + 1] == 1))
              ch = true;
          }
          if ((j > 0) && (C[i][j - 1][y] == 1)) {
            if ((j + 1 < m) && (C[i][j + 1][y] == 1)) ch = true;
            if ((i + 1 < n) && (C[i + 1][j - 1][y] == -1) &&
                (C[i + 1][j][y] == 1))
              ch = true;
            if ((y + 1 < k) && (C[i][j - 1][y + 1] == -1) &&
                (C[i][j][y + 1] == 1))
              ch = true;
          }
          if ((y > 0) && (C[i][j][y - 1] == 1)) {
            if ((y + 1 < k) && (C[i][j][y + 1] == 1)) ch = true;
            if ((i + 1 < n) && (C[i + 1][j][y - 1] == -1) &&
                (C[i + 1][j][y] == 1))
              ch = true;
            if ((j + 1 < m) && (C[i][j + 1][y - 1] == -1) &&
                (C[i][j + 1][y] == 1))
              ch = true;
          }
          if (ch == true) ans += 1;
        }
      }
  cout << ans;
  return 0;
}
