#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
const int Max_n = 1e5;
int a[Max_n];
int main()
{
int n;
scanf("%d",&n);
for(int i = 1;i <= n;i ++)
scanf("%d",&a[i]);
int x = (a[n]+1)/2;
int sum = 0;
for(int i = n-1;i >= 1;i --){
x = (x+a[i]+1)/2;
}
cout<<x<<endl;
return 0;
}