gr = [-1] * 60 def g(n): if n < 60 and gr[n] >= 0: return gr[n] f = [0] * 60 d = 0 m = n while m != 0: if m % 2 == 1: f[g(d)] = 1 d += 1 m >>= 1 a = 0 while f[a] == 1: a += 1 if n < 60: gr[n] = a return a n = int(input()) e = 1 x = 0 for i in list(map(int, input().split())): if i < 0: e = 1 - e else: x ^= g(i) print(2 if e == 1 and x == 0 else 1)