n = int(input()) a_list = list(map(int, input().split())) current = {1} zero_flag = False for a in a_list: if zero_flag: print(1) continue new_current = set() for x in current: new_current.add(x * a) new_current.add(x & a) # Check if all new elements are 0 if len(new_current) == 1 and 0 in new_current: zero_flag = True print(len(new_current)) current = new_current