#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const unsigned gen_seed =
    std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937_64 gen(gen_seed);
int main() {
  int n;
  scanf("%d", &n);
  std::vector<int> a(n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  std::vector<int> st;
  std::vector<int> cnt(n, 0);
  for (int i = 0; i < n; i++) cnt[i] = a[i] / 2;
  for (int i = 0; i < n; i++)
    if (a[i] % 2) st.push_back(i);
  int out = 0;
  int pt = int(st.size()) - 1;
  int cur = n - 1;
  while (pt >= 0) {
    while (cur >= 0 && cnt[cur] == 0) cur--;
    if (cur == -1) {
      out += pt + 1;
      break;
    }
    while (pt >= 0 && st[pt] > cur) {
      out++;
      pt--;
    }
    if (pt == -1) break;
    pt--;
    cnt[cur]--;
  }
  long long sum = 0;
  for (int i = 0; i < n; i++) sum += a[i];
  cout << (sum - out) / 3;
}
