#include <iostream>
#include <bits/stdc++.h>

using namespace std;

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