import math ans = 0 N=int(input()) P = [] for i in range(N): x, y = map(int, input().split()) P.append((x, y)) point_info = dict() for i in range(N): for j in range(i+1, N): if P[i]==P[j]: continue x1, y1 = P[i] x2, y2 = P[j] tyuten_x = [x1+x2, 2] if (x1+x2)%2==0: tyuten_x = [(x1+x2)//2, 1] tyuten_x = tuple(tyuten_x) tyuten_y = [y1+y2, 2] if (y1+y2)%2==0: tyuten_y = [(y1+y2)//2, 1] tyuten_y = tuple(tyuten_y) tyuten = (tyuten_x, tyuten_y) # 方向 vec vec = [x1-x2, y1-y2] if vec[1]<0: vec[0]*=-1; vec[1]*=-1 if x1-x2==0: vec[1] = abs(vec[1]) if y1-y2==0: vec[0] = abs(vec[0]) g = math.gcd(abs(vec[0]), abs(vec[1])) vec[0]//=g; vec[1]//=g vec = tuple(vec) if point_info.get((tyuten_x, tyuten_y, vec))==None: point_info[(tyuten_x, tyuten_y, vec)] = 0 point_info[(tyuten_x, tyuten_y, vec)] += 1 for key in point_info: tyuten_x, tyuten_y, (vec_0, vec_1) = key inv_vec = [-vec_1, vec_0] if inv_vec[1]<0: inv_vec[0]*=-1; inv_vec[1]*=-1 if inv_vec[0]==0: inv_vec[1]=abs(inv_vec[1]) if inv_vec[1]==0: inv_vec[0]=abs(inv_vec[0]) inv_vec = tuple(inv_vec) if point_info.get((tyuten_x, tyuten_y, inv_vec))!=None: ans += point_info[(tyuten_x, tyuten_y, inv_vec)] print(ans//2) # print(point_info)