let f xs = let size = Array.length let isOdd x = x % 2 <> 0 let odds = xs |> Array.where(isOdd) let eves = xs |> Array.where(isOdd >> fun x -> not x) let oddsN = odds |> size let evesN = eves |> size match (isOdd oddsN), (isOdd evesN) with | true, true -> 0 | true, _ -> 1 | _, true -> 1 | _ -> 2 let R() = stdin.ReadLine() let N = R() |> int let X = R().Split() |> Array.map int f X |> stdout.WriteLine