#include <bits/stdc++.h>
using namespace std;
bool A[105][105][105], B[105][105][105];
int X, Y, Z, rs;
char c;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> X >> Y >> Z;
  for (int i = 1; i <= X; i++)
    for (int j = 1; j <= Y; j++)
      for (int l = 1; l <= Z; l++) {
        cin >> c;
        A[i][j][l] = (c == '1');
      }
  for (int i = 1; i <= X; i++)
    for (int j = 1; j <= Y; j++)
      for (int l = 1; l <= Z; l++) {
        if (A[i][j][l] &&
            ((A[i][j - 1][l] && A[i][j + 1][l]) ||
             (A[i][j][l - 1] && A[i][j][l + 1]) ||
             (A[i - 1][j][l] && A[i + 1][j][l]) ||
             (!A[i][j - 1][l + 1] && A[i][j - 1][l] && A[i][j][l + 1]) ||
             (!A[i][j + 1][l - 1] && A[i][j + 1][l] && A[i][j][l - 1]) ||
             (A[i - 1][j][l] && ((!A[i - 1][j + 1][l] && A[i][j + 1][l]) ||
                                 (!A[i - 1][j][l + 1] && A[i][j][l + 1]))) ||
             (A[i + 1][j][l] && ((!A[i + 1][j - 1][l] && A[i][j - 1][l]) ||
                                 (!A[i + 1][j][l - 1] && A[i][j][l - 1])))))
          rs++;
      }
  cout << rs;
  return 0;
}
