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.*;
import java.util.*;

public class Main {
	public static void main(String[] args)throws IOException{
		PrintWriter pw = new PrintWriter(System.out);
        InputReader in = new InputReader(System.in);
        int n = in.nextInt();
        int[] x = new int[n];
        int[] y = new int[n];
        
        for(int i=0;i<n;i++){
        	x[i] = in.nextInt();
        	y[i] = in.nextInt();
        }
        HashMap<String, Integer> h = new HashMap<String, Integer>();
        Stack<String> s = new Stack<String>();
        ArrayList<Pair> a = new ArrayList<>();

//        int[] a = new int[(n+1)*(n+1)];
//        int[] b = new int[(n+1)*(n+1)];
        for(int i=0;i<n;i++){
        	for(int j=i+1;j<n;j++){
        		if(i!=j){
        			a.add(new Pair(x[i]+x[j],y[i]+y[j]));
        			
//        			System.out.println(a+" "+b);
//        			String abc = a+" "+b;
//        			if(h.get(abc)==null){
////        				System.out.println("Hi");
//        				h.put(abc, 1);
//        				s.push(abc);
//        			}
//        			
//        			else{
//        				h.put(abc, h.get(abc)+1);
//        			}
        		}
        	}
        }
        
        Collections.sort(a);
        long ans=0;
        long[] u = new long[a.size()];
        long[] v = new long[a.size()];
        int cnt=0;
        for(Pair p:a){
        	u[cnt] = p.first;
        	v[cnt] = p.second;
        	cnt++;
        }
        
        int count=1;
        for(int i=1;i<cnt;i++){
        	if(u[i]==u[i-1] && v[i]==v[i-1]){
        		count++;
        	}
        	
        	else{
        		long z = count;
        		z*=(z-1);
        		z/=2;
        		ans+=z;
        		count=1;
        	}
        }
        long z = count;
		z*=(z-1);
		z/=2;
		ans+=z;
		count=1;
        pw.println(ans);
        pw.close();
	}
	
	public static  class Pair implements Comparable<Pair>
    {
        long first,second;
        Pair(long first,long second)
        {
            this.second=second;
            this.first=first;
        }
        @Override
        public int compareTo(Pair o) {
            if(first!=o.first)
                return Long.compare(first, o.first);
            return Long.compare(second, o.second);
        }
        
        public int hashcode()
        {
            return 0;
        }
        
        public boolean equals(Object o)
        {
            return true;
        }
        
    }


static class InputReader {
		 
		private InputStream stream;
		private byte[] buf = new byte[8192];
		private int curChar;
		private int snumChars;
		private SpaceCharFilter filter;
 
		public InputReader(InputStream stream) {
			this.stream = stream;
		}
 
		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
 
		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
 
			int res = 0;
 
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
 
			return res * sgn;
		}
		
		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
 
			long res = 0;
 
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
 
			return res * sgn;
		}
		
		public String readString() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}
 
		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
 
		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}
