#include <iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	double a[n],p[n],z=0,maxi=0;
	for (int i=0;i<n;i++){
		cin>>a[i]>>p[i];
	}
	for (int i=0;i<n;i++){
		for (int j=0;j<n;j++){
			if(p[j]>=p[i]){
				z=z+p[i]*a[j];
			}
		}
		if(maxi<z)
			maxi=z;
		z=0;
	}
	cout<<maxi;
}