from itertools import combinations from math import gcd from collections import defaultdict n = int(input()) points = [tuple(map(int,input().split())) for _ in range(n)] mids = defaultdict(int) for (x0,y0),(x1,y1) in combinations(points, 2): dx = x1-x0 dy = y1-y0 if dx == 0: dy = 1 elif dy == 0: dx = 1 else: d = gcd(dx, dy)*(-1 if dx < 0 else 1) dx //= d dy //= d mids[x0+x1, y0+y1, dx, dy] += 1 res = 0 for (mx, my, dx, dy), cnt in mids.items(): if dy <= 0: continue res += cnt*mids.get((mx, my, dy, -dx), 0) print(res)