#include <bits/stdc++.h>
using namespace std;
struct st {
  long long t, w, q;
  bool operator<(const st &x) const { return x.q < q; }
} f[300005], u;
long long n, a, b, ans, idx;
priority_queue<st> pq;
bool cmp(const st &x, const st &y) { return y.t < x.t; }
int main() {
  scanf("%I64d%I64d%I64d", &n, &a, &b);
  for (int i = 1; i < n; i++) {
    scanf("%I64d%I64d", &f[i].t, &f[i].w);
    f[i].q = f[i].w - f[i].t + 1;
  }
  sort(f + 1, f + n, cmp);
  for (idx = 1; idx < n && f[idx].t > a; idx++) pq.push(f[idx]);
  ans = pq.size();
  while (!pq.empty()) {
    u = pq.top();
    pq.pop();
    if (u.q > a) break;
    a -= u.q;
    while (idx < n && f[idx].t > a) pq.push(f[idx++]);
    ans = min(ans, (long long)pq.size());
  }
  printf("%I64d\n", ans + 1);
  return 0;
}
