module Main

let n = stdin.ReadLine() |> int
let a = stdin.ReadLine().Split(' ') |> Array.map int

let rec times a : int array =
    if Array.sum a % 2 = 0 then
        Array.map (fun x -> x / 2) a
        |> Array.append a
        |> Array.distinct
        |> times
    else a

times a 
|> Array.length
|> fun x -> (x / n) - 1
|> stdout.WriteLine
