#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int mxn = 2e5;
array<int,2> ar[mxn];
double y,ans,rel;
ll suma;
int n,x,proc;
int main()
{
	scanf("%i",&n);
	for(int i=0;i<n;i++)scanf("%i%lf",&x,&y),ar[i][0]=(int)(y*1000),ar[i][1]=x,suma+=x;
	sort(ar,ar+n);
	ans = suma*(ar[0][0]/100000.0);
	for(int i=1;i<n;i++)
	{
		suma-=ar[i-1][1];
		rel=suma*(ar[i][0]/100000.0);
		if(rel>ans)ans=rel;
	}
	printf("%lf",ans);	
}