You are given n points on a plane. All the points are distinct and no three of them lie on the same line. Find the number of parallelograms with the vertices at the given points.

Input

The first line of the input contains integer n (1 ≤ n ≤ 2000) — the number of points.

Each of the next n lines contains two integers (xi, yi) (0 ≤ xi, yi ≤ 109) — the coordinates of the i-th point.

Output

Print the only integer c — the number of parallelograms with the vertices at the given points.

Example

Input

4
0 1
1 0
1 1
2 0


Output

1
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {

    final static double EPS = 1e-9;


    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String args[]) throws IOException {

        FastReader read = new FastReader();
        int n = read.nextInt();
        Point[] points = new Point[n];
        for(int i=0;i<n;i++){
            points[i] = new Point(read.nextInt(),read.nextInt());
        }
        Arrays.sort(points);
        HashMap<Point,Integer> countMap = new HashMap<>();
        for(int i=0;i<n;i++){
            for(int j=i+1;j<n;j++){
                Point mid = new Point((points[i].x+points[j].x),(points[i].y+points[j].y));
                if(countMap.containsKey(mid)){
                    int oldCnt = countMap.get(mid);
                    countMap.put(mid,oldCnt+1);
                }else{
                    countMap.put(mid,1);
                }
            }
        }
        int ans=0;
        for(Map.Entry<Point,Integer> entry : countMap.entrySet()){
            Point key = entry.getKey();
            Integer value = entry.getValue();
            int cnt = value;
            ans+= (cnt * (cnt-1))/2;
        }
        System.out.println(ans);

    }
}


class Point implements Comparable<Point> {

    final static double EPS = 1e-9;

    public Integer x, y;

    public Point() {
        x = y = 0;
    }

    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public int compareTo(Point other) {
        if (Math.abs(x - other.x) > EPS)                // useful for sorting
            return (int) Math.ceil(x - other.x);       // first: by x-coordinate
        else if (Math.abs(y - other.y) > EPS)
            return (int) Math.ceil(y - other.y);      // second: by y-coordinate
        else
            return 0;
    }

    @Override
    public boolean equals(Object obj) {
        Point p = (Point) obj;
        return x.equals(p.x) && y.equals(p.y);
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 71 * hash + this.x;
        hash = 71 * hash + this.y;
        return hash;
    }
}