# 2020/05/17
# AtCoder Beginner Contest 168 - E

# Input
n = int(input())
ablist = list()
for i in range(n):
    ab = list(map(int, input().split()))
    ablist.append(ab)

# Init
fctl = list()
fctl.append(1)
f = 1
fctl.append(f)

for i in range(2, n+1):
    f = f * i
    fctl.append(f)

# nCr : c = n! / (r! * (n - r)!)
# Calc
allcom = n
for i in range(2, n):
    allcom = allcom + (fctl[n] // (fctl[i] * fctl[n-i]))

ans = allcom
wklist = list()

for i in range(n-1):
    for j in range(n):
        wkval = ablist[i][0] * ablist[j][0] + ablist[i][1] * ablist[j][1]
        if wkval == 0:
            wklist.append([i,j])

# Output
print(ans - (fctl[10] // (fctl[len(wklist)] * fctl[10-len(wklist)]) * 3))
