#include <bits/stdc++.h>
using namespace std;
const long long N = 300005;
const long long M = 1005;
const long long mod = 1000000007;
const long long inf = (1 << 30);
const long long linf = (1LL << 61);
long long n, v[N], nr1, nr2, d;
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cin >> n;
  for (long long i = 1; i <= n; ++i) cin >> v[i];
  for (long long i = 1; i <= n; ++i) {
    nr2 += v[i] / 2;
    if (v[i] % 2) nr1++;
    if (nr2 > nr1) {
      d = (nr2 - 1 - nr1) / 3 + 1;
      nr2 -= d;
      nr1 += 2 * d;
    }
  }
  cout << min(nr1, nr2);
  return 0;
}
