#include <bits/stdc++.h>
using namespace std;
typedef struct sword {
  int damage, flag;
  bool operator<(const struct sword& a) const { return damage > a.damage; }
} SWORD, *PSWORD;
SWORD s[200001];
int main() {
  int N, H, i, count = 0, ans = 0;
  scanf("%d %d", &N, &H);
  for (i = 0; i < N; i++) {
    scanf("%d", &s[count].damage);
    s[count++].flag = 0;
    scanf("%d", &s[count].damage);
    s[count++].flag = 1;
  }
  sort(s, s + count);
  i = 0;
  while (H > 0) {
    H -= s[i].damage;
    ans++;
    if (s[i].flag == 1) i++;
  }
  printf("%d", ans);
  return 0;
}
