N = int(input())
K = [tuple(map(int, input().split())) for _ in range(N)]
count = 0
for i in range(N):
    for j in range(i, N):
        if (K[i][0] * K[j][0]) + (K[i][1] * K[j][1]) == 0:
            break
        else:
            count += 1

print(count)
