#include <iostream>
#include <vector>
using namespace std;
int main(){
	double n,j,t,i,max=0,l=0;
	
	cin>>n;
	vector <int> a (n);
	vector <double> b (n);
	for (i=0;i<n;i++){
		
		cin>>a[i];
		cin>>b[i];
	}
	for(i=0;i<n;i++){
		t=0;
		for (j=0;j<n;j++){
			if(b[i]<=b[j]) t+=a[j]*b[i];
		}
		if(t>max) max=t;
	}
	cout<<max;
}