#include <bits/stdc++.h>
using namespace std;
const int size = 101;
struct point {
  int x, y, z;
  point(int _x, int _y, int _z) {
    x = _x;
    y = _y;
    z = _z;
  }
};
bool inp[size][size][size];
bool mas[size][size][size] = {0};
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int x = 0; x < n; x++) {
    for (int y = 0; y < m; y++) {
      for (int z = 0; z < k; z++) {
        char c;
        cin >> c;
        if (c == '0')
          inp[x][y][z] = false;
        else
          inp[x][y][z] = true;
      }
    }
  }
  for (int y = 0; y < m; y++) {
    for (int z = 0; z < k; z++) {
      int q = 1;
      for (int x = 0; x < n; x++) {
        if (!inp[x][y][z])
          q = 0;
        else {
          if (!(q == 1 || (x == n - 1) || (!inp[x + 1][y][z]))) {
            mas[x][y][z] = true;
          }
        }
        q++;
      }
    }
  }
  for (int x = 0; x < n; x++) {
    for (int z = 0; z < k; z++) {
      int q = 1;
      for (int y = 0; y < m; y++) {
        if (!inp[x][y][z])
          q = 0;
        else {
          if (!(q == 1 || (y == m - 1) || (!inp[x][y + 1][z]))) {
            mas[x][y][z] = true;
          }
        }
        q++;
      }
    }
  }
  for (int y = 0; y < m; y++) {
    for (int x = 0; x < n; x++) {
      int q = 1;
      for (int z = 0; z < k; z++) {
        if (!inp[x][y][z])
          q = 0;
        else {
          if (!(q == 1 || (z == k - 1) || (!inp[x][y][z + 1]))) {
            mas[x][y][z] = true;
          }
        }
        q++;
      }
    }
  }
  for (int x = 0; x < n; x++) {
    for (int y = 0; y < m; y++) {
      for (int z = 0; z < k; z++) {
        if (!mas[x][y][z] && inp[x][y][z]) {
          vector<int> in;
          vector<int> out;
          if (x - 1 >= 0 && inp[x - 1][y][z]) in.push_back(1);
          if (y - 1 >= 0 && inp[x][y - 1][z]) in.push_back(2);
          if (z - 1 >= 0 && inp[x][y][z - 1]) in.push_back(3);
          if (x + 1 < n && inp[x + 1][y][z]) out.push_back(1);
          if (y + 1 < m && inp[x][y + 1][z]) out.push_back(2);
          if (z + 1 < k && inp[x][y][z + 1]) out.push_back(3);
          for (int iI = 0; iI < in.size(); iI++) {
            for (int iO = 0; iO < out.size(); iO++) {
              int I = in[iI];
              int O = out[iO];
              if (I == O)
                mas[x][y][z] = true;
              else {
                int dx = 0, dy = 0, dz = 0;
                switch (I) {
                  case 1:
                    dx = -1;
                    break;
                  case 2:
                    dy = -1;
                    break;
                  case 3:
                    dz = -1;
                    break;
                }
                switch (O) {
                  case 1:
                    dx = 1;
                    break;
                  case 2:
                    dy = 1;
                    break;
                  case 3:
                    dz = 1;
                    break;
                }
                if (!inp[x + dx][y + dy][z + dz]) mas[x][y][z] = true;
              }
            }
          }
        }
      }
    }
  }
  long long ans = 0;
  for (int x = 0; x < n; x++) {
    for (int y = 0; y < m; y++) {
      for (int z = 0; z < k; z++) {
        if (mas[x][y][z]) ans++;
      }
    }
  }
  cout << ans;
}
