#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N, M;
  cin >> N >> M;
  long long count = 0;
  long long a = 0;
  vector<long long> A(N);
  vector<long long> B(N);
  for (long long i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
    count += B[i];
    a = max(a, A[i]);
  }
  if (count > M) {
    cout << (M - count + a - 1) / a << endl;
  } else {
    sort(B.rbegin(), B.rend());
    long long ans = 0;
    for (long long i = 0; i < N; i++) {
      ans += B[i];
      if (ans >= M) {
        cout << i + 1 << endl;
      }
    }
  }
}
