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

namespace ConsoleApplication1
{
    class Duplo
    {
        public int x;
        public int y;
    }
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Duplo[] a = new Duplo[n];
            for (int i = 0; i < n; i++)
            {
                string[] s = Console.ReadLine().Split();
                a[i] = new Duplo();
                a[i].x = int.Parse(s[0]);
                a[i].y = int.Parse(s[1]);
            }
            int br = 0;
            for (int i = 0; i < a.Length; i++)
                for (int l = i + 1; l < a.Length; l++)
                    for (int j = l + 1; j < a.Length; j++)
                        for (int k = j + 1; k < a.Length; k++)
                        {
                            if (a[i].y == a[l].y && a[j].y == a[k].y && a[j].y != a[i].y && (Math.Abs(a[i].x - a[l].x) == 2 * Math.Abs(a[j].x - a[k].x) || 2 * Math.Abs(a[i].x - a[l].x) == Math.Abs(a[j].x - a[k].x)))
                                br++;
                            else if (a[i].y == a[j].y && a[l].y == a[k].y && a[l].y != a[i].y && (Math.Abs(a[i].x - a[j].x) == 2 * Math.Abs(a[l].x - a[k].x) || 2 * Math.Abs(a[i].x - a[j].x) == Math.Abs(a[l].x - a[k].x)))
                                br++;
                            else if (a[i].y == a[k].y && a[j].y == a[l].y && a[j].y != a[i].y && (Math.Abs(a[i].x - a[k].x) == 2 * Math.Abs(a[j].x - a[l].x) || 2 * Math.Abs(a[i].x - a[k].x) == Math.Abs(a[j].x - a[l].x)))
                                br++;
                            else if (a[i].x == a[l].x && a[j].x == a[k].x && a[j].x != a[i].x && (Math.Abs(a[i].y - a[l].y) == 2 * Math.Abs(a[j].y - a[k].y) || 2 * Math.Abs(a[i].y - a[l].y) == Math.Abs(a[j].y - a[k].y)))
                                br++;
                            else if (a[i].x == a[j].x && a[l].x == a[k].x && a[l].x != a[i].x && (Math.Abs(a[i].y - a[j].y) == 2 * Math.Abs(a[l].y - a[k].y) || 2 * Math.Abs(a[i].y - a[j].y) == Math.Abs(a[l].y - a[k].y)))
                                br++;
                            else if (a[i].x == a[k].x && a[j].x == a[l].x && a[j].x != a[i].x && (Math.Abs(a[i].y - a[k].y) == 2 * Math.Abs(a[j].y - a[l].y) || 2 * Math.Abs(a[i].y - a[k].y) == Math.Abs(a[j].y - a[l].y)))
                                br++;
                            else
                            {
                                double a1 = Math.Sqrt((a[i].x - a[l].x) ^ 2 + (a[i].y - a[l].y) ^ 2);
                                double b1 = Math.Sqrt((a[j].x - a[k].x) ^ 2 + (a[j].y - a[k].y) ^ 2);
                                double c1 = Math.Sqrt((a[i].x - a[j].x) ^ 2 + (a[i].y - a[j].y) ^ 2);
                                double d1 = Math.Sqrt((a[l].x - a[k].x) ^ 2 + (a[l].y - a[k].y) ^ 2);
                                double x = (a1 + (c1 * c1 - d1 * d1) / a1) / 2;
                                double y = a1 - x;
                                double h1 = Math.Sqrt(c1 * c1 - x * x);
                                double h2 = Math.Sqrt(d1 * d1 - y * y);
                                if ((h1.ToString("0") == h2.ToString("0") && a1.ToString("0") == (2 * b1).ToString("0")) || (h1.ToString("0") == h2.ToString("0") && (2 * a1).ToString("0") == b1.ToString("0")))
                                    br++;
                                else
                                {
                                    Duplo pom = a[i];
                                    a[i] = a[k];
                                    a[k] = pom;
                                    double a12 = Math.Sqrt((a[i].x - a[l].x) ^ 2 + (a[i].y - a[l].y) ^ 2);
                                    double b12 = Math.Sqrt((a[j].x - a[k].x) ^ 2 + (a[j].y - a[k].y) ^ 2);
                                    double c12 = Math.Sqrt((a[i].x - a[j].x) ^ 2 + (a[i].y - a[j].y) ^ 2);
                                    double d12 = Math.Sqrt((a[l].x - a[k].x) ^ 2 + (a[l].y - a[k].y) ^ 2);
                                    double x2 = (a12 + (c12 * c12 - d12 * d12) / a12) / 2;
                                    double y2 = a12 - x;
                                    double h12 = Math.Sqrt(c12 * c12 - x2 * x2);
                                    double h22 = Math.Sqrt(d12 * d12 - y2 * y2);
                                    if ((h12.ToString("0") == h22.ToString("0") && a12.ToString("0") == (2 * b12).ToString("0")) || (h12.ToString("0") == h22.ToString("0") && (2 * a12).ToString("0") == b12.ToString("0")))
                                        br++;
                                    else
                                    {
                                        Duplo pom2 = a[l];
                                        a[l] = a[i];
                                        a[i] = pom2;
                                        double a13 = Math.Sqrt((a[i].x - a[l].x) ^ 2 + (a[i].y - a[l].y) ^ 2);
                                        double b13 = Math.Sqrt((a[j].x - a[k].x) ^ 2 + (a[j].y - a[k].y) ^ 2);
                                        double c13 = Math.Sqrt((a[i].x - a[j].x) ^ 2 + (a[i].y - a[j].y) ^ 2);
                                        double d13 = Math.Sqrt((a[l].x - a[k].x) ^ 2 + (a[l].y - a[k].y) ^ 2);
                                        double x3 = (a13 + (c13 * c13 - d13 * d13) / a13) / 2;
                                        double y3 = a13 - x;
                                        double h13 = Math.Sqrt(c13 * c13 - x * x);
                                        double h23 = Math.Sqrt(d13 * d13 - y * y);
                                        if ((h13.ToString("0") == h23.ToString("0") && a13.ToString("0") == (2 * b13).ToString("0")) || (h13.ToString("0") == h23.ToString("0") && (2 * a13).ToString("0") == b13.ToString("0")))
                                            br++;
                                    }

                                }
                            }
                        }
            Console.WriteLine(br);
        }
    }
}