#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
using namespace std;
long long n, heal;
struct attack {
  long long damage, thro;
};
attack a[100005], b[100005];
long long dam;
int rule(attack x, attack y) {
  if (x.damage > y.damage)
    return 1;
  else if (x.damage == y.damage && x.thro > y.thro)
    return 1;
  return 0;
}
int rule1(attack x1, attack y1) {
  if (x1.thro > y1.thro)
    return 1;
  else if (x1.thro == y1.thro && x1.damage > y1.damage)
    return 1;
  return 0;
}
int prime(int x) {
  if (x == 1) return 0;
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return 0;
  return 1;
}
int main() {
  cin >> n >> heal;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].damage >> a[i].thro;
    b[i].damage = a[i].damage;
    b[i].thro = a[i].thro;
    dam += a[i].thro;
  }
  sort(a + 1, a + n + 1, rule);
  sort(a + 2, a + n + 1, rule1);
  long long ans = 0, k = 0;
  int f = 0;
  if (heal <= dam) f = 1;
  for (int i = 2; i <= n; i++) {
    if (heal > 0 && a[i].thro > a[1].damage) {
      heal -= a[i].thro;
      k++;
    } else if (heal > 0 && f == 1) {
      heal -= a[i].thro;
      k++;
    }
  }
  if (heal <= 0) {
    cout << k;
    return 0;
  }
  ans = k;
  while (heal > 0) {
    if (heal <= a[1].thro) {
      ans++;
      break;
    } else {
      heal -= a[1].damage;
      ans++;
    }
  }
  cout << ans;
  return 0;
}
