#include <bits/stdc++.h>
using namespace std;
struct node {
  int a, b;
} ob[200000];
int compare_(node ob, node ob1) { return ob.a > ob1.a; }
int dp[100001];
int dp_(node ob[], int i, int n) {
  int beacons = 0;
  int pos = ob[i].a - ob[i].b;
  if (ob[i].b >= ob[i].a) {
    beacons = n - (i + 1);
    return beacons;
  }
  for (int j = i + 1; j < n; j++) {
    if (ob[j].a < pos) {
      if (ob[j].b >= ob[j].a) {
        beacons += n - (j + 1);
        return beacons;
      }
      if (dp[j] == -1) {
        dp[j] = dp_(ob, j, n);
      }
      beacons += dp[j];
      return beacons;
    } else {
      beacons++;
    }
  }
  return beacons;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> ob[i].a >> ob[i].b;
  }
  memset(dp, -1, sizeof dp);
  sort(ob, ob + n, compare_);
  int min_beacon = INT_MAX;
  for (int i = 0; i < n; i++) {
    if (dp[i] == -1) {
      dp[i] = dp_(ob, i, n);
    }
    if (dp[i] + i < min_beacon) {
      min_beacon = dp[i] + i;
    }
  }
  cout << min_beacon << endl;
  return 0;
}
