#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[100001];
int a[100001];
int dp[100001];
int main(int argc, char const *argv[]) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf(" %d %d ", &p[i].first, &p[i].second);
    a[i] = p[i].first;
  }
  sort(a, a + n);
  sort(p, p + n);
  int mx = 0;
  for (int i = 0; i < n; ++i) {
    int up = -1;
    up = upper_bound(a, a + i + 1, p[i].first - p[i].second - 1) - a;
    if (~up) --up;
    dp[i] = 1 + (~up ? dp[up] : 0);
    mx = max(mx, dp[i]);
  }
  printf("%d\n", n - mx);
  return 0;
}
