#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long num, total = 0;
  cin >> num;
  long long left = 0, temp;
  while (num--) {
    cin >> temp;
    if (left > 0) {
      long long t = temp / 2;
      if (t >= left) {
        total += left;
        temp = temp - 2 * left;
        left = 0;
      } else {
        total += t;
        left -= t;
        temp = temp % 2;
      }
      total += temp / 3;
      left += temp % 3;
    } else {
      total += temp / 3;
      left += temp % 3;
    }
  }
  cout << total << endl;
}
