let main () =
  let s = Scanf.scanf "%d\n" Batteries.identity in
  let arr = Array.make s 0 in
  for i = 0 to s - 2 do
    Array.set arr i (Scanf.scanf "%d " Batteries.identity)
  done;
  Array.set arr (s - 1) (Scanf.scanf "%d\n" Batteries.identity);
  let is_all_even arr = Array.fold_left (fun acc elm -> elm mod 2 = 0 && acc) true arr in
  let rec loop acc arr = (
    if is_all_even arr then (
      let arr = Array.map (fun i -> i / 2) arr in
      loop (acc + 1) arr
    ) else acc
  ) in
  Printf.printf "%d\n" (loop 0 arr)

let _ = main ()
