#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> beac[100002];
int dest[100002];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d %d", &beac[i].first, &beac[i].second);
  sort(beac, beac + n);
  for (int i = 0; i < n; i++) {
    int tmp = lower_bound(beac, beac + n,
                          make_pair(beac[i].first - beac[i].second, 0)) -
              beac;
    dest[i] = i - tmp + dest[tmp - 1];
  }
  int ans = n;
  for (int i = 0; i < n; i++) {
    ans = min(ans, dest[i] + n - i - 1);
  }
  printf("%d\n", ans);
  return 0;
}
