#include<bits/stdc++.h>
# define endl            '\n'
# define clr(x,a)        memset(x,a,sizeof(x))
# define PI              3.14159265358979323846
# define vi              vector<int>
# define fo(i,n)         for(int i=1;i<=n;i++)
# define all(a)          a.begin(), a.end()
# define deb(x)          cout<<#x<<" = "<<x<<endl;
# define pb              push_back
# define sc              scanf
# define pr              printf
# define tc              int t; cin>>t; while(t--)
typedef long long ll;
using namespace std;

const ll mxN=200005, mxM=1000006, mod=1e9+7;
int n;
double p;
ll suma, sol;
struct slog{
   int a, p;
   bool operator <(const slog &P){
      return p>P.p;
   }
}niz[mxN];

int main(){
   cin>>n;
   for(int i=1; i<=n; i++){
      sc("%d %lf", &niz[i].a, &p);
      niz[i].p=round(p*100);
   }
   sort(niz+1, niz+1+n);

   for(int i=1; i<=n; i++){
      suma=suma+(ll)niz[i].a;
      if(suma*niz[i].p>sol) sol=suma*niz[i].p;
   }
   cout<<setprecision(6)<<fixed;

   cout<<sol/10000.0<<endl;
/*
4
100001 83.2
40001 20
90001 77.32
300001 1.88
*/
   return 0;
}