#include<bits\stdc++.h>

using namespace std;

int a[200000];
double p[200000];

int main()
{
	int n;
	cin >> n;
	double r = 0;
	for(int i = 0; i < n; i++) cin >> a[i] >> p[i];
	for(int i = 0; i < n; i++)
	{
		double t = 0;
		for(int j = 0; j < n; j++) if(p[j] >= p[i]) t += p[i] * a[i];
		if(t > r) r = t;
	}
	cout << r;
}