#include<iostream>
#include<iomanip>

using namespace std;


void FICA()
{
    long long n;

    cin>>n;

    long long niz[n];
    double p[n];

    long long maxsum = 0;

    for(long long i = 0;i<n; ++i){
        cin>>niz[i]>>p[i];
        maxsum += niz[i];
    }

for(int i=0;i<n-1;++i){
        for(int j=0;j<n-1-i;++j){
            if(p[j] > p[j+1]){
                swap(p[j],p[j+1]);
                swap(niz[j],niz[j+1]); }
        }
    }
    /*for(int i=0;i<n;++i){
        cout<<niz[i]<<" "<<p[i]<<endl;
    }*/

    long double x = 0.0;
    long double mami = INT_MIN;

    for(int i=0;i<n;++i){
        x = 0.0;
        x = maxsum * p[i];

        if(mami < x)
            mami = x;
        maxsum -= niz[i];
    }

    cout<<fixed<<mami;
}

int main(void)
{
    FICA();
    return 0;
}