n = int(input())
i = 0
x = []
y = []
dx = []
s = []
d = []
resenje = 0
while i < n:
    u1,u2 = input().split()
    u1 = int(u1)
    u2 = int(u2)
    x.append(u1)
    y.append(u2)
    i +=1
i = 0
while i < n:
    ii = i + 1
    while ii < n:
        if x[i]==x[ii]:
            dx.append(abs(y[i]-y[ii]))
        else:
            s.append((y[i]-y[ii])/(x[i]-x[ii]))
            d.append(math.sqrt((x[i]-x[ii])*(x[i]-x[ii]) + (y[i]-y[ii])*(y[i]-y[ii])))
        ii +=1
    i+=1
i = 0
ii = 0
while i < len(s):
    ii = i + 1
    while ii < len(s):
        if s[i]==s[ii] and (d[i] == d[ii]*2 or 2*d[i] == d[ii]):
            resenje = resenje + 1
        ii +=1
    i+=1
i = 0
while i < len(dx):
    ii = i + 1
    while ii < len(dx):
        if dx[i] == dx[ii]*2 or 2*dx[i] == dx[ii]:
            resenje = resenje + 1
        ii +=1
    i +=1
print(resenje)