#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
 
using namespace std;

#define int long long
 
struct segtree {
    vector<int> dat;
    int n;
 
    segtree(int n_) {
        n = 1;
 
        while (n < n_) n *= 2;
 
        dat.resize(2*n, 0);
    }
 
    void update(int i, int x) {
        i += n - 1;
        int diff = x - dat[i];
        dat[i] = x;
 
        while (i > 0) {
            i = (i - 1) / 2;
            dat[i] += diff;
        }
    }
 
    int query(int a, int b, int k = 0, int l = 0, int r = -1) {
        if (r == -1) r = n;
 
        if (r <= a || l >= b) return 0;
 
        if (a <= l && r <= b) {
            return dat[k];
        }
 
        int lv = query(a, b, k * 2 + 1, l, (l + r) / 2);
        int rv = query(a, b, k * 2 + 2, (l + r) / 2, r);
 
        return lv + rv;
    }
};

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int N; cin >> N;
    vector<int> a(N), b(N);
 
    segtree P(N), Q(N);
    vector<tuple<int, int, int>> tmp;
 
    for (int i = 0; i < N; ++i) {
        cin >> a[i] >> b[i];
        tmp.push_back(make_tuple(a[i], i, b[i]));
    }
 
    sort(begin(a), end(a));
    sort(begin(tmp), end(tmp));
 
    vector<pair<int, int>> data;
 
    for (int i = 0; i < N; ++i) {
        int aaa, bbb, val;
        tie(aaa, bbb, val) = tmp[i];
        data.push_back(make_pair(val, i));
    }
 
    sort(begin(data), end(data));
     
    for (int i = 0; i < N; ++i) {
        P.update(i, a[i]);
        Q.update(i, 1);
    }
 
    int ma = 0;
 
    for (int i = 0; i < N; ++i) {
        pair<int, int> d = data[i];
 
        int l = 0, r = N;

        int PP, QQ;
 
        for (int j = 0; j < 20; ++j) {
            int mid = (l + r) / 2;

            PP = P.query(0, mid + 1);
            QQ = Q.query(0, mid + 1);
 
            if (PP <= d.first * QQ) {
                l = mid;
            } else {
                r = mid;
            }
        }
 
        if (PP <= d.first * QQ) {
            ma = max(ma, QQ);
        }
 
        P.update(d.second, 0);
        Q.update(d.second, 0);
    }
 
    cout << ma << endl;
}