#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[b.size()];
      b.pop_back();
    } else {
      H -= a[a.size()];
      a.pop_back();
    }
    sum++;
  }
  cout << sum;
}
