using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    class Program
    {
        struct tacka
        {
            public int x;
            public int y;
        }
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            tacka[] k = new tacka[n];
            var strx = new List<int>();
            var stry = new List<int>();
            var strd = new List<int>();
            int br = 0;
            for(int i = 0; i < n; i++)
            {
                string[] st = Console.ReadLine().Split();
                k[i].x = int.Parse(st[0]); k[i].y = int.Parse(st[1]);
            }
            for(int i = 0; i < n-1; i++)
            {
                for (int j = i + 1; j < n; j++) 
                {
                    if (k[i].x == k[j].x)
                    {
                        if (k[i].y >= 0 && k[j].y >= 0 || k[i].y <= 0 && k[i].y <= 0) strx.Add(Math.Abs(k[i].y - k[j].y));
                        else strx.Add(Math.Abs(k[i].y) + Math.Abs(k[j].y));
                    }
                    else if (k[i].y == k[j].y)
                    {
                        if (k[i].x > 0 && k[j].x > 0 || k[i].x < 0 && k[i].x < 0) stry.Add(Math.Abs(k[i].x - k[j].x));
                        else stry.Add(Math.Abs(k[i].x) + Math.Abs(k[j].x));
                    }
                }
            }
            for (int i = 0; i < strx.Count - 1; i++) for (int j = i; j < strx.Count; j++) if (strx[i] / strx[j] == 2 && strx[i] % strx[j] == 0 || strx[j] / strx[i] == 2 && strx[j] % strx[i] == 0) br++;
            for (int i = 0; i < stry.Count - 1; i++) for (int j = i; j < stry.Count; j++) if (stry[i] / stry[j] == 2 && stry[i] % stry[j] == 0 || stry[j] / stry[i] == 2 && stry[j] % stry[i] == 0) br++;
            Console.WriteLine(br);
            Console.ReadLine();
        }
    }
}