#include <iostream>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int br = 0;
    int a[20000];
    double p[20000];
    double max = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        cin>> p[i];
    }
    for (int i = 0; i < n; i++)
    {
        int s = 0;
        for (int j = 0; j < n; j++)
        {
            if (p[i] > p[j])
            {
                s += 0;
            }
            else
            {
                s += a[j];
            }
        }
        double x = (double)s * p[i];
        if (x > max)
            max = x;
    }
    cout << max;
}