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

namespace Frilenseri
{
    class Program
    {
        static void Main(string[] args)
        {
            int Broj = int.Parse(Console.ReadLine());
            int[] Plate = new int[Broj];
            float[] Porezi = new float[Broj];
            for (int i = 0; i < Broj; i++)
            {
                var line = Console.ReadLine().Split(' ');
                Plate[i] = int.Parse(line[0]);
                Porezi[i] = float.Parse(line[1]);
            }
            float Max = 0;
            for (int i = 0; i < Broj; i++)
            {
                float zbir = 0;
                for (int j = 0; j < Broj; j++) if (Porezi[i] < Porezi[j]) zbir += Porezi[i] * Plate[j];
                if (zbir > Max) Max = zbir;
            }
        }
    }
}