# ABC168 E ∙ (Bullet)
import itertools

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

ng_list = []

for i in range(n):
    for j in range(i+1,n,1):
        if ab_list[i][0] * ab_list[j][0] + ab_list[i][1] * ab_list[j][1] == 0:
            ng_list.append([i,j])

_iter = itertools.product([0,1],repeat=n)
ans = 0
for _ in _iter:
    for _l in ng_list:
        if _[_l[0]] + _[_l[1]] == 2:
            break
    else:
        ans += 1
        
print(ans-1)