#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, z;
  cin >> x >> y >> z;
  vector<bool **> a(x + 1);
  for (int i = 0; i < x + 1; i++) a[i] = new bool *[y + 1];
  for (int i = 0; i < x + 1; i++)
    for (int k = 0; k < y + 1; k++) {
      a[i][k] = new bool[z + 1];
      for (int j = 0; j < z + 1; j++) a[i][k][j] = 0;
    }
  char ch;
  for (int i = 0; i < x; i++) {
    for (int k = 0; k < y; k++) {
      for (int j = 0; j < z; j++) {
        cin >> ch;
        if (ch == '1') a[i][k][j] = 1;
      }
    }
  }
  int lk = 0, lkk = 0;
  ;
  for (int i = 0; i < x; i++) {
    for (int k = 0; k < y; k++) {
      for (int j = 0; j < z; j++)
        if (a[i][k][j]) {
          if (a[i + 1][k][j]) {
            if (i && (a[i - 1][k][j]))
              lkk = 1;
            else if (k && (a[i][k - 1][j]) && (!a[i + 1][k - 1][j]))
              lkk = 1;
            else if (j && (a[i][k][j - 1]) && (!a[i + 1][k][j - 1]))
              lkk = 1;
          }
          if (a[i][k + 1][j]) {
            if (k && (a[i][k - 1][j]))
              lkk = 1;
            else if (i && (a[i - 1][k][j]) && (!a[i - 1][k + 1][j]))
              lkk = 1;
            else if (j && (a[i][k][j - 1]) && (!a[i][k + 1][j - 1]))
              lkk = 1;
          }
          if (a[i][k][j + 1]) {
            if (j && (a[i][k][j - 1]))
              lkk = 1;
            else if (k && (a[i][k - 1][j]) && (!a[i][k - 1][j + 1]))
              lkk = 1;
            else if (i && (a[i - 1][k][j]) && (!a[i - 1][k][j + 1]))
              lkk = 1;
          }
          lk += lkk;
          lkk = 0;
        }
    }
  }
  cout << lk << endl;
  return 0;
}
