#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, ans;
int f[N];
pair<int, int> a[N];
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 + 1 + n);
  ans = n;
  for (int i = 1; i <= n; i++) {
    int j = lower_bound(a + 1, a + i, make_pair(a[i].first - a[i].second, 0)) -
            a - 1;
    f[i] = f[j] + 1;
    ans = min(ans, n - f[i]);
  }
  printf("%d\n", ans);
  return 0;
}
