#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const long long N = 1e6;
long long dr[4] = {0, 0, 1, -1};
long long dc[4] = {1, -1, 0, 0};
long long ddr[8] = {0, 0, 1, -1, 1, -1, 1, -1};
long long ddc[8] = {1, -1, 0, 0, 1, -1, -1, 1};
long long ddr1[8] = {1, 1, -1, -1, 2, 2, -2, -2};
long long ddc1[8] = {2, -2, 2, -2, 1, -1, 1, -1};
char a[110][110][110];
long long ans;
int32_t main() {
  fast();
  long long n, m, k, i, j, l, x, p;
  cin >> n >> m >> k;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      for (l = 1; l <= k; l++) cin >> a[i][j][l];
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      for (l = 1; l <= k; l++)
        if (a[i][j][l] == '1') {
          if (a[i - 1][j][l] == '1' && a[i + 1][j][l] == '1')
            ans++;
          else if (a[i][j - 1][l] == '1' && a[i][j + 1][l] == '1')
            ans++;
          else if (a[i][j][l - 1] == '1' && a[i][j][l + 1] == '1')
            ans++;
          else if (a[i - 1][j][l] == '1' && a[i][j + 1][l] == '1' &&
                   a[i - 1][j + 1][l] == '0')
            ans++;
          else if (a[i - 1][j][l] == '1' && a[i][j][l + 1] == '1' &&
                   a[i - 1][j][l + 1] == '0')
            ans++;
          else if (a[i][j - 1][l] == '1' && a[i + 1][j][l] == '1' &&
                   a[i + 1][j - 1][l] == '0')
            ans++;
          else if (a[i][j - 1][l] == '1' && a[i][j][l + 1] == '1' &&
                   a[i][j - 1][l + 1] == '0')
            ans++;
          else if (a[i][j][l - 1] == '1' && a[i + 1][j][l] == '1' &&
                   a[i + 1][j][l - 1] == '0')
            ans++;
          else if (a[i][j][l - 1] == '1' && a[i][j + 1][l] == '1' &&
                   a[i][j + 1][l - 1] == '0')
            ans++;
        }
  cout << ans << "\n";
}
