#include <bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin>>n;
    vector<pair<long long,long long> > v;
    for(int i=0;i<n;i++){
        long long a;
        double p;
        cin>>a>>p;
        long long h=((p+0.00001)*100);
        v.push_back(make_pair(h,a));
    }
    sort(v.begin(),v.end(),greater<pair<long long,long long> >());
    vector<pair<long long,long long> > presum;
    presum.push_back(make_pair(v[0].first,v[0].second));
    for(int i=1;i<n;i++){
        presum.push_back(make_pair(v[i].first,presum[i-1].second+v[i].second));
    }
    long long maxi=0;
    for(int i=0;i<n;i++){
        maxi=max(maxi,presum[i].first*presum[i].second);
    }
    int b=10000;
    cout<<setprecision(4);
    cout<<fixed;
    double sol = (maxi*1.000)/(b*1.000) ;
    cout<<sol;
}