#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int a[n];
    double p[n];
    for (int i = 0; i < n; i++)
    {
        cin >> a[i] >> p[i];
    }

    double max = p[0];
    for (int i = 1; i < n; i++)
    {
        if (p[i] > max)
        {
            max = p[i];
        }
    }
    long long int zbir = 0;
    for (int i = 0; i < n; i++)
    {
        zbir += a[i];
    }

    double rez = zbir * max * 10;
    int pom = floor(rez);
    if (pom % 10 == 5)
    {
        pom += 5;
    }
    rez = pom / 1000.0;

    cout << fixed << showpoint << setprecision(2) << rez;

    return 0;
}