n = int(input())
li=[]
for _ in range(n):
    li.append(list(map(int, input().split())))

bad_set = set([(i,j) for i in range(n) for j in range(i+1, n) if li[i][0]*li[j][0]+li[i][1]*li[j][1]==0])
minus_sum = 0
add_set = bad_set.copy()
for cnt in range(n):
    if cnt%2==0:
        minus_sum += sum([2**(n-len(s)) for s in add_set])
    else:
        minus_sum -= sum([2**(n-len(s)) for s in add_set])
    add_set = set([])
    for a in bad_set:   
        for b in bad_set:
            a, b = set(a), set(b)
            if a!=b and (tuple(a|b) not in bad_set):
                add_set.add(tuple(a|b))
    
    bad_set = (bad_set | add_set)
    if len(add_set)==0:
        break
ans = 2**n - minus_sum -1
print(ans)