import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv,
    std.functional, std.math, std.numeric, std.range, std.stdio, std.string,
    std.random, std.typecons, std.container;

ulong MAX = 100_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Pair = Tuple!(long, "next", long, "cost");
alias PQueue(T, alias less = "a>b") = BinaryHeap!(Array!T, less);

void main()
{
    auto n = lread();
    auto a = new long[](n);
    n.iota.each!(x => a[x] = lread());
    auto dp = new long[][](n, 2);
    dp[0][0] = a[0] / 2;
    dp[0][1] = a[0] ? (a[0] - 1) / 2 : -INF;
    foreach (i; iota(n - 1))
    {
        dp[i + 1][0] = max(dp[i][0] + a[i + 1] / 2, dp[i][1] + (a[i + 1] + 1) / 2);
        dp[i + 1][1] = a[i + 1] ? max(dp[i][0] + (a[i + 1] - 1) / 2, dp[i][1] + a[i + 1] / 2) : -INF;
    }
    // dp.each!(x => x.writeln());
    max(dp[n - 1][0], dp[n - 1][1]).writeln();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}
