import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  auto n = readln.chomp.to!int;
  auto a = new int[](n+1);
  long res;
  foreach (i; 1..n+1) {
    a[i] = readln.chomp.to!int;
    if (a[i-1]) {
      auto num = min(a[i-1], a[i]);
      a[i-1] -= num;
      a[i] -= num;
      res += num;
    }
    auto num = a[i] / 2;
    res += num;
    a[i] = a[i] % 2;
  }
  res.writeln;
}
