(* O(|xs|) *)
let array_count f = Array.fold_left (fun n x -> if f x then n + 1 else n) 0
let array_for_all f xs = Array.length xs = array_count f xs

(* O(n * log(max a_s)) *)
let _ = Scanf.scanf "%d" @@ fun n ->
  let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" @@ (+) 0 in
  let rec count i =
    let f x = x mod 2 = 0 in
    if not @@ array_for_all f a_s then i
    else let g i a = a_s.(i) <- a / 2 in
      Array.iteri g a_s;
      count (i + 1) in
  count 0 |> Printf.printf "%d\n"