#include <bits/stdc++.h>
using namespace std;
const int nx[8] = {2, -2, -2, 2, 1, 1, -1, -1};
const int ny[8] = {1, 1, -1, -1, 2, -2, -2, 2};
const long long LINF = (long long)2e18;
const int INF = 1e9 + 7;
const int N = 2e5 + 100;
const int MAXN = 5e7 + 50;
const double EPS = 1e-9, PI = 2 * acos(0.0);
int n, m, k;
int a[101][101][101];
int ans, tmr;
bool ok(int x, int y, int z) {
  return (x >= 1 && x <= n && y >= 1 && y <= m && z >= 1 && z <= k &&
          a[x][y][z]);
}
bool can(pair<pair<int, int>, int> x, pair<pair<int, int>, int> y) {
  queue<pair<pair<int, int>, int> > q;
  q.push(x);
  map<pair<pair<int, int>, int>, bool> was;
  was[x] = 1;
  while (!q.empty()) {
    pair<pair<int, int>, int> fr = q.front();
    q.pop();
    for (int second = 0; second < 3; second++) {
      pair<pair<int, int>, int> go = fr;
      if (!second)
        go.first.first++;
      else if (second == 1)
        go.first.second++;
      else
        go.second++;
      if (ok(go.first.first, go.first.second, go.second) &&
          go.first.first <= y.first.first &&
          go.first.second <= y.first.second && go.second <= y.second) {
        if (!was[go]) {
          was[go] = 1;
          q.push(go);
        }
      }
    }
  }
  return was[y];
}
int main() {
  srand(time(NULL));
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("\n");
      for (int z = 1; z <= k; z++) {
        char c;
        scanf("%c", &c);
        a[i][j][z] = c - '0';
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int z = 1; z <= k; z++) {
        if (a[i][j][z] == 0) continue;
        vector<pair<pair<int, int>, int> > nadnlassad, asdaslknd;
        for (int second = 0; second < 3; second++) {
          int gi = i, gj = j, gz = z;
          if (!second)
            gi--;
          else if (second == 1)
            gj--;
          else
            gz--;
          if (ok(gi, gj, gz))
            nadnlassad.push_back(make_pair(make_pair(gi, gj), gz));
        }
        for (int second = 0; second < 3; second++) {
          int gi = i, gj = j, gz = z;
          if (!second)
            gi++;
          else if (second == 1)
            gj++;
          else
            gz++;
          if (ok(gi, gj, gz))
            asdaslknd.push_back(make_pair(make_pair(gi, gj), gz));
        }
        a[i][j][z] = 0;
        bool ok = 0;
        for (auto it : nadnlassad) {
          for (auto it1 : asdaslknd) {
            if (!can(it, it1)) {
              ok = 1;
              break;
            }
          }
          if (ok) {
            ans++;
            break;
          }
        }
        a[i][j][z] = 1;
      }
    }
  }
  printf("%d", ans);
  return 0;
}
