#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 23;
long long a[N], dp[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  dp[1] = a[1] / 3;
  long long sum = a[1];
  for (int i = 2; i <= n; i++) {
    long long pre = min(sum - dp[i - 1] * 3, a[i] / 2);
    dp[i] = dp[i - 1] + pre + (a[i] - 2 * pre) / 3;
    sum += a[i];
  }
  cout << dp[n] << endl;
}
