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

namespace Zad_A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] x = new int[n];
            int[] y = new int[n];
            int br = 0;
            for (int i = 0; i < n; i++)
            {
                string[] s = Console.ReadLine().Split();
                x[i] = int.Parse(s[0]);
                y[i] = int.Parse(s[1]);
            }
            for (int i = 0; i < n-3; i++)
            {
                for (int j = i+1; j < n-2; j++)
                {
                    for (int l= j+1; l < n-1; l++)
                    {
                        for (int k = l+1; k < n; k++)
                        {
                            if (i!=j && i!=l && i!=k && j!=l && j!=k && l!=k)
                            {
                                if ((Math.Abs(x[i] - x[j]) + Math.Abs(y[i] - y[j]) == 2 * (Math.Abs(x[l] - x[k]) + Math.Abs(y[l] - y[k])) || 2 * (Math.Abs(x[i] - x[j]) + Math.Abs(y[i] - y[j])) == (Math.Abs(x[l] - x[k]) + Math.Abs(y[l] - y[k]))) || (Math.Abs(x[i] - x[l]) + Math.Abs(y[i] - y[l]) == 2 * (Math.Abs(x[j] - x[k]) + Math.Abs(y[j] - y[k])) || 2 * (Math.Abs(x[i] - x[l]) + Math.Abs(y[i] - y[l])) == (Math.Abs(x[j] - x[k]) + Math.Abs(y[j] - y[k]))))
                                {
                                    br++;
                                }
                            }
                        }
                    }
                }
            }
            Console.WriteLine(br);
        }
    }
}