let f xs = let size = Array.length let isOdd x = x % 2 <> 0 let isEve x = not <| isOdd x let odds = xs |> Array.where(isOdd) let eves = xs |> Array.where(isEve) let oddsN = odds |> size let evesN = eves |> size match (isEve oddsN), (isEve 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