#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin>>n;
    pair<double,double>a[n];
    for(int i=0;i<n;++i)
    {
        cin>>a[i].second>>a[i].first;
    }
    double ans=0;

    sort(a,a+n);

    double pref=0;
    for(int i=n-1;i>=0;--i)
    {
        pref+=a[i].second;
        ans=max(ans,pref*a[i].first);
    }

    cout<<ans;
    return 0;

}