#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>

using namespace std;

#define pb push_back
#define x first
#define y second
#define IOS ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;

int main()
{
    IOS;
    int n;
    cin >> n;
    vector<pll > a(n);
    ll sum = 0;
    for (int i = 0; i < n; i++) {
        double tmp;
        cin >> a[i].y >> tmp;
        a[i].x = (tmp + 0.005) * 100;
        sum += a[i].y;
    }
    sort(a.begin(), a.end());
    ll cur = 0, pr = 0;
    for (int i = 0; i < n; i++) {
        ll tmp = (sum - cur) * a[i].x;
        pr = max(tmp, pr);
        cur += a[i].y;
    }
    double ans = pr * 1.0 / 10000;
    cout << fixed << setprecision(4) << ans;
    return 0;
}