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

namespace takmicenje
{
    class Program
    {
        static double A;
        static float P;
        
        static void Main(string[] args)
        {
            //deklaracija
            int n = int.Parse(Console.ReadLine());
            string input;
            string[] d = new string[2];
            
            int[] a = new int[n];
            float[] p = new float[n];

            A = a[0];
            P = p[0];

            //unos a i p
            for (int i = 0; i < n; i++)
            {
                input = Console.ReadLine();
                d = input.Split(' ');
                a[i] = int.Parse(d[0]);
                p[i] = float.Parse(d[1]);
            }
            for (int i = 1; i < n; i++)
            {
                P = Check(a[i], p[i]);
            }

            Console.WriteLine(A * P);
        }

        static float Check(int a2, float p2)
        {
            if(P < p2)
            {
                if ((A + a2) * P > a2 * p2)
                {
                    A += a2;
                    return P;
                }
                else
                {
                    A = a2;
                    return p2;
                }
            }
            else
            {
                if ((A + a2) * p2 > A * P)
                {
                    A += a2;
                    return p2;
                }
                else
                {
                    return P;
                }
            }
        }
    }
}