#include <bits/stdc++.h>
using namespace std;
int N;
long long H;
long long wield;
long long thrower;
vector<pair<long long, int> > katanas;
long long addThis;
int main() {
  scanf("%d %lld", &N, &H);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &wield);
    katanas.push_back(make_pair(wield, 0));
    scanf("%lld", &thrower);
    katanas.push_back(make_pair(thrower, 1));
  }
  sort(katanas.begin(), katanas.end());
  int cnt = 0;
  long long sum = 0;
  for (int i = katanas.size() - 1; i >= 0; i--) {
    if (katanas[i].second == 0) {
      addThis = i;
      break;
    } else {
      sum += katanas[i].first;
      cnt++;
    }
  }
  while (sum < H) {
    sum += katanas[addThis].first;
    cnt++;
  }
  printf("%d\n", cnt);
  return 0;
}
