from collections import defaultdict
import sys
from fractions import Fraction

count = defaultdict(int)
if 1:
    N = int(sys.stdin.readline())

    edges = defaultdict(list)
    for i in range(N):
        A, B = [int(x) for x in sys.stdin.readline().split()]
        if B == 0:
            angle = "I"
        else:
            angle = Fraction(A, B)
        count[angle] += 1

pairs = {}
solos = []
for k1 in count:
    if k1 in pairs:
        continue
    for k2 in count:
        if k1 * k2 == -1:
            pairs[k2] = k1
            break
    else:
        solos.append(k1)
print(pairs, solos)


def power(n):
    1000000007


result = 1
for p in pairs:
    print("pair", p, count[p], pairs[p], count[pairs[p]])
    n = count[p]
    m = count[pairs[p]]
    result *= (2 ** n - 1) + (2 ** m - 1) + 1
for k in solos:
    print("solo", k, count[k])
    result *= 2 ** count[k]

print(result - 1)
