#include <bits/stdc++.h>
using namespace std;
const int N = 300010;
long long a[N];
int n;
long long res;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  long long free = 0;
  for (int i = 0; i < n; ++i) {
    long long take = min(free, a[i] / 2);
    res += take;
    a[i] -= 2 * take;
    free -= take;
    while (a[i] % 3 != 0)
      if (a[i] >= 2 && free) {
        a[i] -= 2;
        ++res;
        --free;
      } else
        break;
    res += a[i] / 3;
    free += a[i] % 3;
  }
  cout << res << endl;
}
