import std.stdio, std.string, std.algorithm, std.array, std.range, std.conv,
    std.typecons, std.math, std.container, std.format, std.numeric;

void main(string[] args)
{
    long n;
    readf("%d\n", &n);

    long ans = 0;
    long before = 0;
    long b = 0;
    long a;
    foreach (i; 0 .. n)
    {
        readf("%d\n", &a);
        b = (a + before) / 2;
        ans += b;
        before = (a - b * 2);
    }

    writeln(ans);
}
