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.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

//import org.junit.Test;

public class btp {
//	@Test
//	public void test(){
//		for(int i=2;i<10;i++)
//		System.out.println(combination(i));
//	}
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		Node[] nd=new Node[n];
		for(int i=0;i<n;i++){
			double x=sc.nextInt();
			double y=sc.nextInt();
			nd[i]=new Node(x,y);
		}
//		for(int i=0;i<n;i++){
//			System.out.println(nd[i]);
//		}
		List<Edge> list=new ArrayList<Edge>();
		for(int i=0;i<n;i++){
			for(int j=i+1;j<n;j++){
				Double rake_radio=getRake_radio(nd[i],nd[j]);
				double length=getLength(nd[i],nd[j]);
				list.add(new Edge(rake_radio,length));
				//System.out.println(rake_radio+" "+length);
			}
		}
		int num=0;
		int k=1;
		boolean flag=true;
		//排序
		Collections.sort(list,new MyComparator());
		//遍历method3
		for(int i=1;i<list.size();i++){
		if(list.get(i).equals(list.get(i-1))){
			k++;
			flag=false;
			if(i==list.size()-1)num+=combination(k);
		}
		else{
			if(flag==false)num+=combination(k);
			flag=true;
			k=1;
		}
		
	}
		
		//遍历method2
//		for(int i=1;i<list.size();){
//			if(list.get(i).equals(list.get(i-1))){
//				for(int j=i;j<list.size();j++){
//					if(list.get(j).equals(list.get(i-1))){
//						k++;
//					}
//					if(!list.get(j).equals(list.get(i-1))){
//						num+=combination(k);
////						System.out.println(k+" "+combination(k));
//						i+=(k-1);
//						k=1;
//						break;
//					}
//				}
//			}
//			else{
//				i++;
//			}
//		}
		//遍历method1
//		for(int i=0;i<list.size();i++){
//			for(int j=i+1;j<list.size();j++){
//				if(list.get(i).equals(list.get(j))){
//					num++;
//				}
//			}
//		}
		System.out.println(num/2);
//		Iterator<Edge> i=list.iterator();
//		while(i.hasNext())System.out.println(i.next());
		
		sc.close();
	}
	//求阶乘
	public static int factorial(int n){
//		if(n==0)return 1;
//		else return n*factorial(n-1);
		if(n==0)return 1;
		int sum=1;
		while(n>=1){
			sum*=n;
			n--;
		}
		return sum;
	}
	//组合公式
	public static int combination(int m){
		return (factorial(m)/(2*factorial(m-2)));
	}
	//求斜率
	public static Double getRake_radio(Node n1,Node n2){
		if(n2.getX()-n1.getX()==0)return null;
		else return (n2.getY()-n1.getY())/(n2.getX()-n1.getX())*1.0;
	}
	//求边长
	public static double getLength(Node n1,Node n2)
	{
		return Math.sqrt((Math.pow(n2.getY()-n1.getY(), 2))+(Math.pow(n2.getX()-n1.getX(), 2)));
	}
	//坐标类
	static class Node{
		private double x;
		private double y;
		Node(double x,double y){
			this.x=x;
			this.y=y;
		}
		Node(){}
		public double getX() {
			return x;
		}
		public void setX(double x) {
			this.x = x;
		}
		public double getY() {
			return y;
		}
		public void setY(double y) {
			this.y = y;
		}
		@Override
		public String toString() {
			return "Node [x=" + x + ", y=" + y + "]";
		}
	}
	//边长类
	static class Edge{
		Double rake_radio;
		double length;
		Edge(){}
		public Edge(Double rake_radio, double length) {
			super();
			this.rake_radio = rake_radio;
			this.length = length;
		}
		public Double getRake_radio() {
			return rake_radio;
		}
		public void setRake_radio(Double rake_radio) {
			this.rake_radio = rake_radio;
		}
		public double getLength() {
			return length;
		}
		public void setLength(double length) {
			this.length = length;
		}
		@Override
		public String toString() {
			return "Edge [rake_radio=" + rake_radio + ", length=" + length
					+ "]";
		}
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			long temp;
			temp = Double.doubleToLongBits(length);
			result = prime * result + (int) (temp ^ (temp >>> 32));
			result = prime * result
					+ ((rake_radio == null) ? 0 : rake_radio.hashCode());
			return result;
		}
		@Override
		public boolean equals(Object obj) {
			//-0.0和0.0的情况
			if(this!=null&&obj!=null){
				Edge other1 = (Edge) obj;
				if(this.getRake_radio()!=null&&other1.getRake_radio()!=null){
					if((this.getRake_radio()==-0.0&&other1.getRake_radio()==0.0)
					||(this.getRake_radio()==0.0&&other1.getRake_radio()==-0.0)){
						if(this.getLength()==other1.getLength())return true;
					}
				}
			}
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Edge other = (Edge) obj;
			if (Double.doubleToLongBits(length) != Double
					.doubleToLongBits(other.length))
				return false;
			if (rake_radio == null) {
				if (other.rake_radio != null)
					return false;
			} else if (!rake_radio.equals(other.rake_radio)){
				return false;
			}
			return true;
		}
	}
	//自定义排序
	static class MyComparator implements Comparator<Edge>{
		@Override
		public int compare(Edge e1, Edge e2) {
			if(e1.getRake_radio()==null&&e2.getRake_radio()!=null){
				return 1;
			}
			if(e1.getRake_radio()!=null&&e2.getRake_radio()==null){
				return -1;
			}
			if(e1.getRake_radio()==null&&e2.getRake_radio()==null){
				if(e1.getLength()-e2.getLength()>0)return 1;
				if(e1.getLength()-e2.getLength()==0)return 0;
				if(e1.getLength()-e2.getLength()<0)return -1;
			}
			if(e1.getRake_radio()!=null&&e2.getRake_radio()!=null){
				if(!e1.getRake_radio().equals(e2.getRake_radio())){
					if(e1.getRake_radio()-e2.getRake_radio()>0)return 1;
					if(e1.getRake_radio()-e2.getRake_radio()<0)return -1;
				}
				else{
					if(e1.getLength()-e2.getLength()>0)return 1;
					if(e1.getLength()-e2.getLength()==0)return 0;
					if(e1.getLength()-e2.getLength()<0)return -1;
				}
			}
			return 0;
		}
		
	}
	
}