#include <bits/stdc++.h>
struct nyin {
  long long s, c;
} p[299999];
int N, O = 1000000000;
long long score, _, INSUM;
std::priority_queue<long long> IN;
std::priority_queue<long long, std::vector<long long>, std::greater<long long> >
    OUT;
int main() {
  scanf("%d%lld%lld", &N, &score, &_);
  p[0] = {0, 0};
  for (int i = 1; i < N; i++) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    p[i].s = x, p[i].c = y - x + 1;
  }
  std::sort(p, p + N, [](const nyin &x, const nyin &y) { return x.s < y.s; });
  int cur = 0;
  while (cur < N && p[cur].s <= score) cur++;
  if (cur == N) {
    puts("1");
    return 0;
  }
  for (int i = cur + 1; i < N; i++) OUT.push(p[i].c);
  for (int i = cur - 1; ~i; i--) {
    OUT.push(p[i + 1].c);
    if (!IN.empty()) {
      OUT.push(IN.top());
      INSUM -= IN.top();
      IN.pop();
    }
    while (!OUT.empty() && OUT.top() + INSUM <= score - p[i].s) {
      INSUM += OUT.top();
      IN.push(OUT.top());
      OUT.pop();
    }
    if (int(OUT.size()) < O) O = OUT.size();
  }
  printf("%d\n", O + 1);
  return 0;
}
