#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  int left = 0;
  long long ans = 0;
  for (int i = 0; i < (int)(n); i++) {
    int max_2 = a[i] / 2;
    int c2 = min(max_2, left);
    a[i] -= 2 * c2;
    left -= c2;
    ans += c2;
    int c3 = a[i] / 3;
    a[i] -= 3 * c3;
    ans += c3;
    left += a[i];
  }
  cout << ans << endl;
  return 0;
}
