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
  Printf.printf "%d\n" @@
    Array.fold_left ( + ) 0 (Array.map (fun a -> a / 2) as_)
    + snd (Array.fold_left (fun (prev, acc) b -> if prev && b then (false, acc + 1) else (b, acc)) (false, 0) @@ Array.map (fun a -> a mod 2 = 1) as_)