import numpy as np

n = int(input())
a = []
b = []

for i in range(n):
    l = list(map(int, input().split()))
    a.append(l[0])
    b.append(l[1])

a = np.array(a)
b = np.array(b)

l = np.dot(a.reshape((len(a), 1)), a.reshape((1, len(a)))) + np.dot(b.reshape((len(b), 1)), b.reshape((1, len(b))))
l = l.flatten()

print(np.sum(l == 0))

