open Scanf
open Printf
    

let _ =
  let n = scanf "%d\n" (fun x -> x) in
  let ar = Array.make n 0 in
  let _ =
    for i=0 to (n-1) do
      scanf "%d\n" (fun x -> Array.set ar i x)
    done
  in
  let ans = ref 0 in
  let _ = Array.map
      (fun x -> ans := !ans + x / 2;x mod 2) ar
  in
  let _ =
    for i=0 to (n-2) do
      let i0 = Array.get ar i in
      let i1 = Array.get ar (i+1) in
      if i0 = 1 && i1 = 1 then
        ans := !ans + 1; Array.set ar (i+1) 0
    done
  in
  printf "%d\n" !ans