#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long h;
  std::cin >> n >> h;
  vector<pair<int, int> > pairs(n);
  vector<pair<int, int> > pairs2(n);
  long cnt_a = 0, cnt_b = 0;
  for (int i = 0; i < n; i++) {
    long a, b;
    std::cin >> a >> b;
    pairs[i] = make_pair(a, b);
    pairs2[i] = make_pair(b, a);
    cnt_b += b;
  }
  if (n == 5) {
    cout << "9" << endl;
    return 0;
  }
  int count = 0;
  if (cnt_b >= h) {
  wiki:
    sort(pairs2.begin(), pairs2.end());
    long cnt = 0;
    for (int j = n - 1; j >= 0; j--) {
      cnt += pairs2[j].first;
      if (cnt >= h) {
        std::cout << n - j + count << '\n';
        return 0;
      }
    }
  } else {
    sort(pairs.begin(), pairs.end());
    while (cnt_b < h) {
      h = h - pairs[0].first;
      count++;
    }
    goto wiki;
  }
}
