#include <bits/stdc++.h>
using namespace std;
int n, ans = 10000000;
struct node {
  int a, b;
} bac[100005] = {{0}};
int f[100005] = {0};
bool cmp(node x, node y) { return x.a < y.a; }
int findi(int R, int x) {
  int l = 0, r = R - 1, mid;
  while (l < r) {
    mid = (l + r + 1) >> 1;
    if (bac[mid].a >= x)
      r = mid - 1;
    else
      l = mid;
  }
  return l;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &bac[i].a, &bac[i].b);
  sort(bac + 1, bac + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    int qaq = findi(i, bac[i].a - bac[i].b);
    f[i] = f[qaq] + (i - qaq - 1);
    ans = min(ans, f[i] + (n - i));
  }
  cout << ans << endl;
  return 0;
}
