let () =
  let n = Scanf.scanf "%d\n" (fun n -> n) in
  let as_ = Array.init n (fun _ -> Scanf.scanf "%d\n" (fun a -> a)) in
  Array.fold_left (fun (acc, prev) a ->
    if prev && 1 <= a then (acc + 1 + (a - 1) / 2, (a - 1) mod 2 = 1)
    else (acc + a / 2, a mod 2 = 1)) (0, false) as_
  |> fst
  |> Printf.printf "%d\n"