Do you know Just Odd Inventions? The business of this company is to "just odd inventions". Here, it is abbreviated as JOI.

JOI is conducting research to confine many microorganisms in one petri dish alive. There are N microorganisms to be investigated, and they are numbered 1, 2, ..., N. When each microorganism is trapped in a petri dish, it instantly releases a harmful substance called foo (fatally odd object) into the petri dish. The amount of foo released by each microorganism is known. The foo released by all the microorganisms trapped in the petri dish is evenly ingested by each microorganism in the petri dish. The foo tolerance of each microorganism is known, and if foo is ingested in excess of this amount, the microorganism will die.

The foo release amount of the microorganism i is ai milligrams, and the foo tolerance is bi milligrams. That is, when the microorganisms i1, i2, ..., ik are trapped in the petri dish, each microorganism in the petri dish ingests (ai1 + ai2 + ... + aik) / k milligrams of foo, and the microorganisms in the petri dish ingest. i will die if this intake is greater than bi.

On behalf of JOI, you must keep as many microorganisms alive in the petri dish as possible. However, no microbes in the petri dish should die from ingestion of foo, as carcasses of microorganisms adversely affect the environment in the petri dish.

It is still a mystery how JOI profits from making "just a strange invention", and no one in JOI knows except the president.



input

Read the following input from standard input.

* The integer N is written on the first line, which indicates that there are N microorganisms to be investigated.
* The following N lines contain information on each microorganism. On the first line of i + (1 ≤ i ≤ N), the positive integers ai and bi are written separated by blanks, and the foo emission amount of the microorganism i is ai milligrams and the foo tolerance is bi milligrams. Represent.

output

Output the maximum number of microorganisms that can be confined in one petri dish to the standard output in one line.

Example

Input

6
12 8
5 9
2 4
10 12
6 7
13 9


Output

3
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef double db;

#define fr first
#define sc second
#define pb push_back
#define rep(i,x) for(ll i=0;i<x;i++)
#define rep1(i,x) for(ll i=1;i<=x;i++)
#define rrep(i,x) for(ll i=x-1;i>=0;i--)
#define rrep1(i,x) for(ll i=x;i>0;i--)


ll n;
P a[300000];
priority_queue<P,vector<P> , greater<P> > q; //????????????id
priority_queue<ll,vector<ll>, greater<ll> > list; //?????\??£???????????????id
bool ok(ll X){//X???????????????
	//cout<<"start "<<X<<endl;
	ll jud;//????????\???????????£??????return 1
	ll val=0;
	while(!list.empty()) list.pop();
	while(!q.empty()) q.pop();
	rep(i,n) q.push(P(a[i].fr,i));
	rep(i,X){
		P p=q.top();
		q.pop();
		val+=p.fr;
		list.push(p.sc);
	}
	rep(i,n-X+1){
		jud=a[i].sc*X;
		//cout<<i<<"i    jud"<<jud<<"   val"<<val<<endl;
		if(val<=jud){
			return 1;
		}
		ll m=list.top();
		if(m==i){
			list.pop();
			val-=a[m].fr;
			while(!q.empty()&&q.top().second<=i) q.pop();
			if(q.size()){
				P p=q.top();
				q.pop();
				val+=p.fr;
				list.push(p.sc);
			}
		}
		
	}
	//cout<<endl;
	return 0;
}


int main()
{
	cin>>n;
	rep(i,n) cin>>a[i].fr>>a[i].sc;
	sort(a,a+n,[](P a,P b){
		return a.sc<b.sc;
	});
	//cout<<endl;
	//rep(i,n) cout<<i<<"]="<<a[i].fr<<" "<<a[i].sc<<endl;
	ll ub=n+1;
	ll lb=0;
	while(ub-lb>1){
		ll mid=(ub+lb)/2;
		if(ok(mid)){
			lb=mid;
		}
		else ub=mid;
	}
	cout<<lb<<endl;
}