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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.Set;
import java.util.InputMismatchException;
import java.util.HashMap;
import java.io.IOException;
import java.util.function.Supplier;
import java.io.FileNotFoundException;
import java.io.File;
import java.util.Map;
import java.util.Map.Entry;
import java.io.Writer;
import java.io.UnsupportedEncodingException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {

  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    OutputWriter out = new OutputWriter(outputStream);
    DNumberOfParallelograms solver = new DNumberOfParallelograms();
    solver.solve(1, in, out);
    out.close();
  }

  static class DNumberOfParallelograms {

    public void solve(int testNumber, InputReader in, OutputWriter out) {
      int n = in.nextInt();
      int[] x = new int[n];
      int[] y = new int[n];
      for (int i = 0; i < n; ++i) {
        x[i] = 2 * in.nextInt();
        y[i] = 2 * in.nextInt();
      }
      CountingMap<IntPair> counter = new CountingMap<>();

      for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
          counter.increment(Factories.makeIntPair((x[i] + x[j]) >> 1, (y[i] + y[j]) >> 1));
        }
      }

      long ans = 0;
      for (Entry<IntPair, Integer> count : counter.entrySet()) {
        ans += count.getValue() * (count.getValue() - 1) / 2;
      }
      out.println(ans);
    }

  }

  static class CountingMap<T> {

    private Map<T, Integer> map;
    private final Supplier<Integer> defaultDataProvider;

    public CountingMap() {
      map = new HashMap<>();
      defaultDataProvider = () -> 0;
    }

    public CountingMap(Supplier<Integer> defaultDataProvider) {
      map = new HashMap<>();
      this.defaultDataProvider = defaultDataProvider;
    }

    public CountingMap(int n) {
      map = new HashMap<>(n);
      defaultDataProvider = () -> 0;
    }

    public CountingMap(CountingMap<T> map) {
      this.map = new HashMap<>(map.map);
      defaultDataProvider = () -> 0;
    }

    public void increment(T key) {
      incrementBy(key, 1);
    }

    public void incrementBy(T key, Integer step) {
      map.put(key, map.getOrDefault(key, 0) + step);
    }

    public String toString() {
      return "CountingMap{" +
          "map=" + map +
          '}';
    }

    public Set<Entry<T, Integer>> entrySet() {
      return map.entrySet();
    }

  }

  static interface FastIO {

  }

  static class OutputWriter extends PrintWriter {

    public OutputWriter(OutputStream os, boolean autoFlush) {
      super(os, autoFlush);
    }

    public OutputWriter(Writer out) {
      super(out);
    }

    public OutputWriter(Writer out, boolean autoFlush) {
      super(out, autoFlush);
    }

    public OutputWriter(String fileName) throws FileNotFoundException {
      super(fileName);
    }

    public OutputWriter(String fileName, String csn)
        throws FileNotFoundException, UnsupportedEncodingException {
      super(fileName, csn);
    }

    public OutputWriter(File file) throws FileNotFoundException {
      super(file);
    }

    public OutputWriter(File file, String csn)
        throws FileNotFoundException, UnsupportedEncodingException {
      super(file, csn);
    }

    public OutputWriter(OutputStream out) {
      super(out);
    }

    public void flush() {
      super.flush();
    }

    public void close() {
      super.close();
    }

  }

  static class IntPair implements Comparable<IntPair> {

    public int first;
    public int second;

    public IntPair() {
      first = second = 0;
    }

    public IntPair(int first, int second) {
      this.first = first;
      this.second = second;
    }

    public int compareTo(IntPair a) {
      if (first == a.first) {
        return Integer.compare(second, a.second);
      }
      return Integer.compare(first, a.first);
    }

    public String toString() {
      return "<" + first + ", " + second + ">";
    }

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

      IntPair a = (IntPair) o;

      if (first != a.first) {
        return false;
      }
      return second == a.second;
    }

    public int hashCode() {
      int result = first;
      result = 31 * result + second;
      return result;
    }

  }

  static final class Factories {

    private Factories() {
    }

    public static IntPair makeIntPair(int first, int second) {
      return new IntPair(first, second);
    }

  }

  static class InputReader implements FastIO {

    private InputStream stream;
    private static final int DEFAULT_BUFFER_SIZE = 1 << 16;
    private static final int EOF = -1;
    private byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
      this.stream = stream;
    }

    public int read() {
      if (this.numChars == EOF) {
        throw new UnknownError();
      } else {
        if (this.curChar >= this.numChars) {
          this.curChar = 0;

          try {
            this.numChars = this.stream.read(this.buf);
          } catch (IOException ex) {
            throw new InputMismatchException();
          }

          if (this.numChars <= 0) {
            return EOF;
          }
        }

        return this.buf[this.curChar++];
      }
    }

    public int nextInt() {
      int c;
      for (c = this.read(); isSpaceChar(c); c = this.read()) {
      }

      byte sgn = 1;
      if (c == 45) {
        sgn = -1;
        c = this.read();
      }

      int res = 0;

      while (c >= 48 && c <= 57) {
        res *= 10;
        res += c - 48;
        c = this.read();
        if (isSpaceChar(c)) {
          return res * sgn;
        }
      }

      throw new InputMismatchException();
    }

    public static boolean isSpaceChar(int c) {
      return c == 32 || c == 10 || c == 13 || c == 9 || c == EOF;
    }

  }
}

