let input_int_array n =
  Array.init n (fun _ -> Scanf.scanf "%d " (fun v -> v))

let () =
  let n = read_int ()
  in let ar = input_int_array n
  in let min_k = Array.fold_left (fun u v ->
    let rec f0 p =
      if p mod 2 = 1 then 0 else (1 + f0 (p/2))
    in let k = f0 v
    in min u k
  ) max_int ar
  in min_k |> string_of_int |> print_endline