func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, f[1000005];   long long ans, las;   int gets() {     int v = 0;     char ch;     bool f = 0;     while (!isdigit(ch = getchar()))       if (ch ==  - ) f = 1;     v = ch - 48;     while (isdigit(ch = getchar())) v = (v << 1) + (v << 3) + ch - 48;     return f ? -v : v;   }   int main() {     n = gets();     for (int i = 1; i <= n; i++) {       f[i] = gets();       long long tmp = min(las, (long long)f[i] / 2);       las -= tmp;       f[i] -= tmp * 2;       ans += tmp;       tmp = f[i] / 3;       ans += tmp;       las += f[i] % 3;     }     cout << ans << endl;   }   