#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int b[maxn], c[maxn];
int n, m;
pair<int, int> st[maxn];
int main() {
  while (~scanf("%d", &n)) {
    memset(st, 0, sizeof(st));
    for (int i = 0; i < n; ++i) {
      scanf("%d %d", &st[i].first, &st[i].second);
    }
    sort(st, st + n);
    for (int i = 0; i < n; ++i) b[i] = st[i].first;
    c[0] = 1;
    int minn = 1;
    for (int i = 1; i < n; ++i) {
      int k = st[i].first - st[i].second;
      int ck = lower_bound(b, b + i + 1, k) - b;
      if (ck == 0) c[i] = 0;
      c[i] = c[ck - 1] + 1;
      minn = max(minn, c[i]);
    }
    printf("%d\n", n - minn);
  }
  return 0;
}
