#include <bits/stdc++.h>
using namespace std;
priority_queue<long long, vector<long long>, greater<long long>> q;
pair<long long, long long> te[300005];
signed main() {
  long long n, t, w;
  cin >> n >> t >> w;
  for (long long i = 2; i <= n; i++) {
    long long x, y;
    cin >> x >> y;
    te[i] = make_pair(x, y);
  }
  sort(te + 2, te + n + 1);
  long long i = n, rank = 0x3f3f3f3f;
  while (1) {
    for (; i >= 2 && te[i].first > t; i--)
      q.push(te[i].second - te[i].first + 1);
    rank = min(rank, (long long)q.size() + 1);
    if (q.size() && t >= q.top()) {
      t -= q.top();
      q.pop();
    } else {
      cout << rank;
      break;
    }
  }
  return 0;
}
