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.InputStreamReader;
import java.util.HashMap;
import java.util.Map;


public class Problem_04 {
    static long EXP = 1000000000L;
    static long dist2(long x1, long y1, long x2, long y2) {
        return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
    }

    static long alpha(long x1, long y1, long x2, long y2) {
        if (x1 == x2) {
            return Long.MAX_VALUE;
        } else {
            return (EXP * (y2 - y1)) / (x2 - x1);
        }

    }

    static class Pair {
        long d;
        long a;

        public Pair(long d, long a) {
            this.d = d;
            this.a = a;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair pair = (Pair) o;

            if (d != pair.d) return false;
            return a == pair.a;

        }

        @Override
        public int hashCode() {
            int result = (int) (d ^ (d >>> 32));
            result = 31 * result + (int) (a ^ (a >>> 32));
            return result;
        }
    }

    public static void main(String[] args) throws Exception {
        Scanner input = new Scanner();
        int n = input.nextInt();
        long[] x = new long[n];
        long[] y = new long[n];

        for (int i = 0; i < n; i++) {
            x[i] = input.nextLong();
            y[i] = input.nextLong();
        }

        HashMap<Pair, Integer> map = new HashMap<>(n + n);
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                long d = dist2(x[i], y[i], x[j], y[j]);
                long a = alpha(x[i], y[i], x[j], y[j]);

                Pair p = new Pair(d, a);
                Integer cnt = map.get(p);
                map.put(p, cnt == null ? 1 : cnt + 1);
            }
        }

        long total = 0;
        for (Integer v : map.values()) {
            if (v > 1) {
                total += ((long) v * (v - 1)) / 2L;
            }
        }

        System.out.println(total / 2);
    }

    static class Scanner {
        final BufferedReader input;
        String[] buffer;
        int pos;


        public Scanner() {
            input = new BufferedReader(new InputStreamReader(System.in));
        }


        private String read() {
            try {
                if (buffer == null || pos >= buffer.length) {
                    buffer = input.readLine().split("\\s+");
                    pos = 0;
                }
                return buffer[pos++];
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
        }

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

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

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

        String nextLine() {
            if (buffer != null && pos < buffer.length) {
                throw new RuntimeException("Buffer is not empty");
            }
            try {
                return input.readLine();
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
        }
    }

}