#include <bits/stdc++.h>
using namespace std;
int n, res, first[1000005];
pair<int, int> a[1000005];
int c[1000005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &a[i].first, &a[i].second);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) c[i] = a[i].first;
  first[0] = 0;
  for (int i = 1; i <= n; i++) {
    int u = lower_bound(c + 1, c + i, a[i].first - a[i].second) - c - 1;
    first[i] = first[u] + 1;
    res = max(res, first[i]);
  }
  printf("%d", n - res);
  return 0;
}
