let n = Scanf.scanf "%d\n" (fun x -> x)

let rec rev_read_ints accu = function
  | 0 -> accu
  | k -> rev_read_ints ((Scanf.scanf "%d\n" (fun x -> x)) :: accu) (k-1)

let a = List.rev (rev_read_ints [] n)

let rec solve = function
  | [] -> 0
  | [x] -> x / 2
  | hd1 :: 0 :: tl -> hd1 / 2 + solve tl
  | hd1 :: hd2 :: tl -> hd1 / 2 + solve ((hd2 + (hd1 mod 2)) :: tl)

let () = print_int (solve a)