#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &x : a) cin >> x;
  long long res = 0, e = 0;
  for (int i = 0; i < n; i++) {
    long long pp = min(a[i] / 2LL, e);
    res += pp;
    a[i] -= (2 * pp);
    e -= (pp);
    res += (a[i] / 3);
    a[i] %= 3;
    e += a[i];
  }
  cout << res << '\n';
}
