#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long res = 0;
  int rem = 0;
  for (int i = 0; i < n; i++) {
    int curr;
    cin >> curr;
    int smol = min(rem, curr / 2);
    curr -= 2 * smol;
    rem -= smol;
    res += smol;
    res += curr / 3;
    rem += curr % 3;
  }
  cout << res << endl;
  return 0;
}
