#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	
	int n;
	cin>>n;
	int a[n];
	double p[n];
	double max=0,zbir=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]){
				zbir+=p[j]*a[j];
			}
		}
		if(zbir>max){
			max=zbir;
		}
		zbir=0;
	}
	cout<<max;
	
	return 0;
}