#include <bits/stdc++.h>
using namespace std;
char arr[105][105][105];
int res[105][105][105];
int main() {
  int z, y, x;
  cin >> z >> y >> x;
  for (int i = 1; i <= z; i++) {
    for (int j = 1; j <= y; j++) {
      for (int k = 1; k <= x; k++) {
        cin >> arr[i][j][k];
      }
    }
  }
  int sum = 0;
  int t;
  for (int i = 1; i <= z; i++) {
    for (int j = 1; j <= y; j++) {
      for (int k = 1; k <= x; k++) {
        if (arr[i][j][k] == '1') {
          t = 0;
          if (arr[i + 1][j][k] == '1' && arr[i - 1][j][k] == '1') t = 1;
          if (arr[i - 1][j][k] == '1' && arr[i][j + 1][k] == '1' &&
              arr[i - 1][j + 1][k] == '0')
            t = 1;
          if (arr[i - 1][j][k] == '1' && arr[i][j][k + 1] == '1' &&
              arr[i - 1][j][k + 1] == '0')
            t = 1;
          if (arr[i][j + 1][k] == '1' && arr[i][j - 1][k] == '1') t = 1;
          if (arr[i][j - 1][k] == '1' && arr[i + 1][j][k] == '1' &&
              arr[i + 1][j - 1][k] == '0')
            t = 1;
          if (arr[i][j - 1][k] == '1' && arr[i][j][k + 1] == '1' &&
              arr[i][j - 1][k + 1] == '0')
            t = 1;
          if (arr[i][j][k + 1] == '1' && arr[i][j][k - 1] == '1') t = 1;
          if (arr[i][j][k - 1] == '1' && arr[i + 1][j][k] == '1' &&
              arr[i + 1][j][k - 1] == '0')
            t = 1;
          if (arr[i][j][k - 1] == '1' && arr[i][j + 1][k] == '1' &&
              arr[i][j + 1][k - 1] == '0')
            t = 1;
          sum += t;
        }
      }
    }
  }
  cout << sum;
}
