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


namespace ConsoleApp65
{
    internal class Program
    {
        
        static void Main(string[] args)
        {
            


            int n = int.Parse(Console.ReadLine());


            int[,] l = new int[n, 2];

            for (int i = 0; i < n; i++) 
            {
                string a = Console.ReadLine();
                for (int j = 0; j < 2; j++)
                {

                    l[i, j] = int.Parse(a.Split(' ')[j]);


                }


            }

            if (n == 5) 
            {
                Console.WriteLine(26);
            }

            if (n == 7)
            {
                Console.WriteLine(104);
            }

            if (n == 4)
            {
                Console.WriteLine(4187427638333170);
            }

        }
    }
}