using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int s = 0;
            string[] str;
            int[] a = new int[1500];
            int[] b = new int[1500];
            int N = int.Parse(Console.ReadLine());
            for (int i = 0; i < N; i++)
            {
                str = Console.ReadLine().Split();
                a[i] = int.Parse(str[0]);
                b[i] = int.Parse(str[1]);
            }
            for (int j = 0; j < N; j++)
            {
                for (int i = j + 1; i < N; i++)
                {
                    for (int l = j + 1; l < N; l++)
                    {
                        for (int k = l + 1; k < N; k++)
                        {
                            if ((Math.Abs(a[j] - a[i]) == Math.Abs(2 * (a[l] - a[k])) || Math.Abs(2 * (a[j] - a[i])) == Math.Abs(a[l] - a[k])) && (Math.Abs(b[j] - b[i]) == Math.Abs(2 * (b[l] - b[k])) || Math.Abs(2 * (b[j] - b[i])) == Math.Abs(b[l] - b[k])))
                            {
                                if (a[j] < a[i] && a[l] < a[k] && ((b[j] > b[i]) == (b[l] > b[k]))) s++;
                                else if (a[j] < a[i] && a[l] > a[k] && ((b[j] > b[i]) == (b[l] < b[k]))) s++;
                                else if (a[j] > a[i] && a[l] < a[k] && ((b[j] < b[i]) == (b[l] > b[k]))) s++;
                                else if (a[j] > a[i] && a[l] > a[k] && ((b[j] < b[i]) == (b[l] < b[k]))) s++;
                                else if (a[j] == a[i]) s++;
                            }
                        }
                    }
                }
            }
            Console.WriteLine(s);
        }
    }
}