import sys
input = sys.stdin.readline
n = int(input().strip())
mod = 10**9+7
ab = [list(map(int,input().split())) for _ in range(n)]
hate = [[] for _ in range(n)]
for i in range(n-1):
  a1,b1 = ab[i]
  for j in range(i+1,n):
    a2,b2 = ab[j]
    if a1*a2+b1*b2 == 0:
      hate[i].append(j)
      hate[j].append(i)
check = [False]*n
#hate_set = []
eok = n
ans = 1
for i in range(n):
  if not check[i]:
    h1 = len(hate[i])
    if len(hate[i])!=0:
      h2 = len(hate[hate[i][0]])
      #hate_set.append((h1,h2))
      ans *= 1+h1*(h1+1)//2+h2*(h2+1)//2
      eok -= h1+h2
      for j in hate[i]:
        check[j] = True
      for j in hate[hate[i][0]]:
        check[j] = True
print(ans*(2**eok)-1)