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

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