#include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define int long long
typedef pair<int,int>P;
main(){
  int n,x,ans=0;
  cin>>n>>x;
  vector<P>v,v1;
  r(i,n){
    int s,t;
    cin>>s>>t;
    v.push_back(P(s,-t));
    v1.push_back(P(t,s));
  }
  sort(v.begin(),v.end(),greater<P>());
  r(i,n)v[0].second*=-1;
  r(i,n){
    if(v1[i].second==v[0].first&&v1[i].first==v[0].second){
      v1.erase(v1.begin()+i);
      break;
    }
  }
  sort(v1.begin(),v1.end(),greater<P>());
  int X=v[0].first;
  int sum=0;
  r(i,n-1){
    if(X>v1[i].first)break;
    x-=v1[i].first;
    ans++;
    if(x<=0){
      cout<<ans<<endl;
      return 0;
    }
  }
  while(1){
    if(x-v[0].second<=0)x=0;
    else x-=v[0].first;
    ans++;
    if(x<=0){
      cout<<ans<<endl;
      break;
    }
  }
}