#include <bits/stdc++.h>
using namespace std;
long long int dam1[100000] = {0};
long long int dam2[100000] = {0};
long long int hp = 0;
long long int ans = 0;
long long int num = 0;
long long int kai = 0;
void dps(int p, int k, int u = 0) {
  if (k < num) {
    if (p <= 0) {
      if (ans > kai || ans == 0) {
        ans = kai;
      }
      return;
    } else {
      if (u == 1 && dam2[k] != 0) {
        p = p - dam1[k];
        kai += 1;
      } else if (u == 2 && dam2[k] != 0) {
        p = p - dam2[k];
        kai += 1;
        dam2[k] = 0;
      }
      if (dam2[k] != 0) {
        dps(p, k, 1);
      }
      dps(p, k + 1, 1);
      dps(p, k + 1, 2);
    }
  } else {
    dps(hp, 0, 1);
    dps(hp, 0, 2);
    dps(hp, 0);
  }
}
int main() {
  cin >> num >> hp;
  for (int i = 0; i < num; i++) {
    cin >> dam1[i] >> dam2[i];
  }
  dps(hp, 0, 1);
  dps(hp, 0, 2);
  dps(hp, 0);
  cout << ans << endl;
  return 0;
}
