#include "iostream"
#include "iomanip"
using namespace std;

int main(){
	long double porezi[10001];
	
	for(int i=0;i<10001;i++)
		porezi[i] = 0;
		
	int n;
	
	cin >> n;
	
	for(int i=0;i<n;i++){
		long double a, p;
		cin >> a >> p;
		porezi[(int)(p*100)] += a;
	}
	
	for(int i=10000-1;i>=0;i--)
		porezi[i]+=porezi[i+1];
			
	long double max=0.0;
	
	for(int i=0;i<10001;i++){
		long double a = porezi[i]*((double)i)/10000.00;
		if(max<a)
			max=a;
	}
	
	cout << std::setprecision(20) << max;
	
	return 0;
}