#include <bits/stdc++.h>
using namespace std;

int main(){
  int N,H;
  cin >> N >> H;
  vector<int> a;
  vector<int> b;
  for(int i=0;i<N;i++){
    int c,d;
    cin >> c >> d;
    a.push_back(c);
    b.push_back(d);
  }
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  int sum=0;
  while(H>0){
    if(b.end()>=a.end()){
      H-=b.end();
      b.pop_back();
    }
    else{
      H-=a.end();
      a.pop_back();
    }
    sum++;
  }
  cout << sum;
    
} 