using System;

class Program
{
    struct Tacka
    {
        public int x;
        public int y;
    }
        static void Kombinacije(Tacka[] tacke, int j, Tacka[] cetvorougao, int i, ref int brojac)
        {
            if (j == 4)
            {
                Trapez(cetvorougao[0], cetvorougao[1], cetvorougao[2], cetvorougao[3], ref brojac);
                return;
            }
            if (i >= tacke.Length) return;
            cetvorougao[j] = tacke[i];
            Kombinacije(tacke, j + 1, cetvorougao, i + 1, ref brojac);
            Kombinacije(tacke, j, cetvorougao, i + 1, ref brojac);
        }
    static void Trapez(Tacka a, Tacka b, Tacka c, Tacka d, ref int brojac)
    {
        if (Nagib(a,b) == Nagib(c,d))
            if ((2 * Math.Sqrt(Math.Pow(a.x - b.x, 2) + Math.Pow(a.y - b.y, 2)) == 
                Math.Sqrt(Math.Pow(c.x - d.x, 2) + Math.Pow(c.y - d.y, 2))) || 
                (Math.Sqrt(Math.Pow(a.x - b.x, 2) + Math.Pow(a.y - b.y, 2)) == 
                2 * Math.Sqrt(Math.Pow(c.x - d.x, 2) + Math.Pow(c.y - d.y, 2))))
                brojac++;
        if (Nagib(a,c) == Nagib(b,d))
            if ((2 * Math.Sqrt(Math.Pow(a.x - c.x, 2) + Math.Pow(a.y - c.y, 2)) ==
                Math.Sqrt(Math.Pow(b.x - d.x, 2) + Math.Pow(b.y - d.y, 2))) ||
                (Math.Sqrt(Math.Pow(a.x - c.x, 2) + Math.Pow(a.y - c.y, 2)) ==
                2 * Math.Sqrt(Math.Pow(b.x - d.x, 2) + Math.Pow(b.y - d.y, 2))))
                brojac++;
        if (Nagib(a,d) == Nagib(b,c))
            if ((2 * Math.Sqrt(Math.Pow(a.x - d.x, 2) + Math.Pow(a.y - d.y, 2)) ==
                Math.Sqrt(Math.Pow(c.x - b.x, 2) + Math.Pow(c.y - b.y, 2))) ||
                (Math.Sqrt(Math.Pow(a.x - d.x, 2) + Math.Pow(a.y - d.y, 2)) ==
                2 * Math.Sqrt(Math.Pow(c.x - b.x, 2) + Math.Pow(c.y - b.y, 2))))
                brojac++;
    }
    static double Nagib (Tacka a, Tacka b)
    {
        if (a.x - b.x == 0) return 0;
        double x = Math.Abs(a.y - b.y);
        double c = Math.Sqrt(Math.Pow(a.x - b.x, 2) + Math.Pow(a.y - b.y, 2));
        return x / c;
    }
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());
        Tacka[] tacke = new Tacka[n];
        for (int i = 0; i<n; i++)
        {
            string[] s = Console.ReadLine().Split();
            tacke[i].x = int.Parse(s[0]);
            tacke[i].y = int.Parse(s[1]);
        }
        int brojac = 0;
        Tacka[] cetvorougao = new Tacka[4];
        Kombinacije(tacke, 0, cetvorougao, 0, ref brojac);
        Console.Write(brojac);
    }
}