#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const int N = 1e5 + 100;
int n, dp[N];
struct b {
  int pos, power;
} bs[N];
bool cmp(const b &l, const b &r) { return l.pos < r.pos; }
int main() {
  int i, j;
  scanf("%d", &n);
  for (i = 0; i < n; ++i) scanf("%d%d", &bs[i].pos, &bs[i].power);
  sort(bs, bs + n, cmp);
  for (i = 1; i < n; ++i) {
    int bound = bs[i].pos - bs[i].power;
    if (bound <= bs[0].pos) {
      dp[i] = i;
    } else {
      int l = 0, r = i - 1;
      int ans;
      while (l <= r) {
        int mid = (l + r) >> 1;
        if (bound <= bs[mid].pos) {
          r = mid - 1;
        } else {
          ans = mid;
          l = mid + 1;
        }
      }
      dp[i] = dp[ans] + i - ans - 1;
    }
  }
  int ans = N;
  for (i = n - 1; i >= 0; --i) {
    ans = min(ans, dp[i] + n - 1 - i);
  }
  cout << ans << endl;
  return 0;
}
