func_code_string: #include <bits/stdc++.h>   using namespace std;   using LL = long long;   using VI = vector<int>;   using VC = vector<char>;   using VS = vector<string>;   using VL = vector<long long>;   using VVI = vector<VI>;   using VVL = vector<VL>;   using MII = map<int, int>;   using MIVI = map<int, VI>;   using MSS = map<string, string>;   using MLL = map<LL, LL>;   int READ_INT() {     int temp;     cin >> temp;     return temp;   }   LL READ_LONG() {     LL temp;     cin >> temp;     return temp;   }   void mcs(VI &series, int &max_sum) {     int s = 0;     for (auto x : series) {       s += x;       max_sum = max(max_sum, s);       if (s < 0) s = 0;     }   }   template <typename T>   T MAX(T t) {     return t;   }   template <typename T, typename... Args>   T MAX(T t, Args... args) {     return max(t, MAX(args...));   }   const int MOD = int(1e9) + 7;   const int INF = 1e9 + 5;   const double PI = acos(-1.0);   const double EPS = 1e-9;   int n, m, k;   int matrix[105][105][105];   int main() {     ios::sync_with_stdio(false);     cin >> n >> m >> k;     for (int i = 1; i < n + 1; ++i) {       for (int j = 1; j < m + 1; ++j) {         string s;         cin >> s;         for (int q = 0; q < k; ++q) {           matrix[i][j][q + 1] = s[q] -  0 ;         }       }     }     int count = 0;     int l = k;     for (int i = 1; i <= n; ++i) {       for (int j = 1; j <= m; ++j) {         for (int k = 1; k <= l; ++k) {           if (matrix[i][j][k] == 0) continue;           int t = 0;           t += (matrix[i][j][k - 1] && matrix[i][j][k + 1]);           t += (matrix[i][j - 1][k] && matrix[i][j + 1][k]);           t += (matrix[i - 1][j][k] && matrix[i + 1][j][k]);           if ((matrix[i][j][k - 1] && matrix[i][j + 1][k]) &&               matrix[i][j + 1][k - 1] == 0)             t++;           if ((matrix[i][j - 1][k] && matrix[i][j][k + 1]) &&               matrix[i][j - 1][k + 1] == 0)             t++;           if ((matrix[i][j - 1][k] && matrix[i + 1][j][k]) &&               matrix[i + 1][j - 1][k] == 0)             t++;           if ((matrix[i - 1][j][k] && matrix[i][j + 1][k]) &&               matrix[i - 1][j + 1][k] == 0)             t++;           if ((matrix[i - 1][j][k] && matrix[i][j][k + 1]) &&               matrix[i - 1][j][k + 1] == 0)             t++;           if ((matrix[i][j][k - 1] && matrix[i + 1][j][k]) &&               matrix[i + 1][j][k - 1] == 0)             t++;           if (t) count++;         }       }     }     cout << count <<   n ;     return 0;   }   