import sys

n = int(input())
stars = []
for line in sys.stdin:
    x, y = map(int, line.split())
    stars.append((x,y))

first = stars[0]
stars = set(stars)

def difff(a, b):
    return (a[0]- b[0], a[1] - b[1])
res = 0

vec = []
for star in stars:
    if star == first:
        continue
    vec.append(difff(first, star))
    vec.append(difff(star, first))
vec = set(vec)

for vector in vec:
    vectors = [vector, (-vector[0], -vector[1])]
    for star in stars:
        if difff(star, vectors[0]) not in stars and difff(star, vectors[1]) not in stars:
            break
    else:
        res+=1
print(res)

