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.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.StringTokenizer;


public class D {

	
	public static void main(String[] args) throws IOException 
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		
		int n = sc.nextInt();
		Point[] points = new Point[n];
		for(int i = 0; i < n; ++i)	
			points[i] = new Point(sc.nextInt(), sc.nextInt());
		
		HashMap<Pair, Integer> map = new HashMap<Pair, Integer>();
		HashMap<Integer, Integer> vertical = new HashMap<Integer, Integer>();
		for(int i = 0; i < n; ++i)
			for(int j = i + 1; j < n; ++j)
			{
				if(points[i].x - points[j].x == 0)
				{	
					Integer dist = Math.abs(points[i].y - points[j].y);
					Integer f = vertical.get(dist);
					if(f == null)
						f = 0;
					vertical.put(dist, f+1);
				}
				else
				{
					Pair p = new Pair(points[i], points[j]);
					Integer f = map.get(p);
					if(f == null)
						f = 0;
					map.put(p, f+1);
					
				}
				
			}
		
		long ans = 0;
		for(Entry<Pair, Integer> e: map.entrySet())
			ans += (long) e.getValue() * (e.getValue() - 1) / 2;
		for(Entry<Integer, Integer> e: vertical.entrySet())
			ans += (long) e.getValue() * (e.getValue() - 1) / 2;
		
		out.println(ans/2);
		
		out.flush();
		out.close();

	}
	
	static class Point
	{
		int x, y;
		Point(int a, int b)
		{
			x = a;
			y = b;
		}
	}
	
	static long sq(long x)
	{
		return x * x;
	}
	
	
	static final double EPS = 1e-9;
	
	static class Pair implements Comparable<Pair>
	{
		long dist2;
		double slope;
		
		Pair(Point p, Point q)
		{
			if(p.x < q.x)
			{
				Point tmp = p;
				p = q;
				q = tmp;
			}
			dist2 = sq(p.x - q.x) + sq(p.y - q.y);
			slope = (double)(p.y - q.y) / (p.x - q.x);
		}
		
		public int compareTo(Pair p)
		{
			if(dist2 != p.dist2)
				return dist2 > p.dist2 ? 1 : -1;
			
			
			if(Math.abs(slope-p.slope) > EPS)
				return slope > p.slope ? 1 : -1;
			return 0;
		}
		
		@Override
		public int hashCode() {
			// TODO Auto-generated method stub
			return Long.hashCode(dist2) * 7 + Double.hashCode(slope);
		}
		
		@Override
		public boolean equals(Object obj) {
			// TODO Auto-generated method stub
			return this.compareTo((Pair)obj) == 0;
		}
		
		
			
		
	}
			

	static class Scanner 
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException 
		{
			while (st == null || !st.hasMoreTokens()) 
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}


	}
}