#include <iostream>
using namespace std;

typedef long long ll;

int main(){
  ll n;
  cin >> n;
  ll a[n];
  for(int i=0;i<n;i++) cin >> a[i];
  ll ans=0;
  ll p=0;
  for(int i=0;i<n;i++){
    ans+=(p+a[i])/2;
    p=(p+a[i])%2;
    if(a[i]==0){
      p=0;
    }
  }
  cout << ans << endl;
}