using System;
using System.Drawing;

namespace konzola
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine(m(n));
        }
        static Point f(Point p1, Point p2)
        {
            return new Point(Math.Abs(p1.X - p2.X), Math.Abs(p1.Y - p2.Y));
        }

static int m(int n)
{
    if (n < 4) return 0;
    int b = 0;
    int x = (n * (n - 1)) / 2;
    Point[] l = new Point[x];
    Point[] t = new Point[n];
    for (int i = 0, br = 0; i < n; i++)
    {
        string[] s = Console.ReadLine().Split();
        t[i].X = int.Parse(s[0]);
        t[i].Y = int.Parse(s[1]);
        for (int i0 = 0; i0 < i; i0++, br++) l[br] = f(t[i], t[i0]);
    }
    for (int i = 0; i < x; i++) for (int i0 = 0; i0 < i; i0++) if (l[i] == l[i0] + (Size)l[i0] || l[i0] == l[i] + (Size)l[i])
            {
                b += 1;
            }
    return b;
}
    }
}