#include <bits/stdc++.h>
 
using namespace std;
 
#define int long long
#define endl '\n'
#define maxn 100010
const int MOD = 1000000007;
 bool compare(const pair<int, int>&i, const pair<int, int>&j)
{
    return i.first > j.first;
}
void solve() {
	int n,B,a,b,count=0,sum=0;cin>>n>>B;
	vector<pair<int,bool> > vc;
    for(int i=1;i<=n;i++)
    {cin>>a>>b; vc.push_back({b,true});vc.push_back({a,false});}
    sort(vc.begin(),vc.end(),compare);
    for(int i=0;i<vc.size();i++)
    {
    	if(vc[i].second==true)
    	sum+=vc[i].first,count++;
    	else
    	{
    		int left=B-sum;// 276=46
    		if(vc[i].first-left>=0){++count;break;}
    		count=count+((left%vc[i].first)?(left/vc[i].first)+1:(left/vc[i].first));
    		break;
    	}
    	if(sum>B)break;
    }
    cout<<count<<endl;
}
 
int32_t main() {
int t=1;
    while (t--)
        solve();
    return 0;
}