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