#include <bits/stdc++.h>
using namespace std;
long long a[300005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, i, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long carry = 0, temp, ans = 0;
  for (i = 0; i < n; i++) {
    temp = min(a[i] / 2, carry);
    ans = ans + temp;
    carry = carry - temp;
    a[i] = a[i] - 2 * temp;
    ans = ans + (a[i] / 3);
    a[i] = a[i] % 3;
    carry = carry + a[i];
  }
  cout << ans;
  return 0;
}
