open Batteries
let () =
  let n = Scanf.scanf "%d " (fun a -> a) in
  let a_lst = Array.to_list @@ Array.init n (fun _ -> Scanf.scanf "%d " (fun a -> a)) in

  let rec aux res cnt = function
      [] -> res
    | hd::tl -> 
      if hd mod 2 = 0 then
        let t = hd/2 in
        aux res (cnt+1) (t::tl)
      else
        aux (cnt::res) 0 tl 
  in

  Printf.printf "%d\n" @@
  List.min (aux [] 0 a_lst)
