local n=io.read("n")
local total=0
local count=0
for i=1,n do
    local a=io.read("n")
    if a==0 then
        count=0
    else
        a=a+count
        total=total+a//2
        count=a%2
    end
end
print(total)