using System;
using System.Linq;
using System.Runtime.InteropServices;

namespace Frilenseri
{
    class Program
    {
        static void ulaz(double a, double b)
        {
            string[] s = Console.ReadLine().Split();
            a = double.Parse(s[0]);
            b = double.Parse(s[1]);
        }
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            double[] zarada = new double [n];
            double[] porez = new double[n];
            double suma = 0;
            for (int i = 0; i < n; i++)
            {
                ulaz(zarada[i], porez[i]);
                suma += zarada[i];
            }
            double[] ZaradaDrzave = new double[n];
            for (int i = 0; i < n; i++)
            {
                ZaradaDrzave[i] = suma * porez[i];
            }
            double NajvecaZaradaDrzave = ZaradaDrzave.Max();
            Console.WriteLine(NajvecaZaradaDrzave);
        }
    }
}