#include <bits/stdc++.h>
using namespace std;
long long A_od_procenta[10002], zbir[10002];
int main()
{
    ios_base::sync_with_stdio(false);
    long long n, i, x, maxans = 0;
    long double pr;
    cin >> n;
    while(n--)
    {
        cin >> x >> pr;
        pr = pr*100;
        i = pr;
        A_od_procenta[i] = A_od_procenta[i] + x;
    }
    for(i = 10000; i >= 0; i--) zbir[i] = zbir[i + 1] + A_od_procenta[i];
    for(i = 0; i <= 10000; i++)
        if(zbir[i]*i > maxans)
            maxans = zbir[i]*i;
    cout << maxans/10000 << "." << maxans%10000;
    return 0;
}