(* O(n log(max a_s)) *)
Scanf.scanf "%d" @@ fun n ->
  let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" @@ (+) 0 in
  let rec count c m = if m mod 2 = 1 then c else count (c + 1) (m / 2) in
  Array.map (count 0) a_s |> Array.fold_left min max_int |> Printf.printf "%d\n"