#include <bits/stdc++.h>
using namespace std;
inline int Readint() {
  int ret = 0;
  int f = 1;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f *= -1;
  } while (ch >= 0 && (ch < '0' || ch > '9'));
  while ('0' <= ch && ch <= '9') {
    ret = ret * 10 + ch - '0';
    ch = getchar();
  }
  return ret * f;
}
void open() {
  freopen("A.in", "r", stdin);
  freopen("A.out", "w", stdout);
}
void close() {
  fclose(stdin);
  fclose(stdout);
}
const int MAXN = 1E6 + 10;
pair<int, int> a[MAXN];
int f[MAXN];
int n;
int mn;
bool cmp(int i, int j) { return a[i] < a[j]; }
void init() {
  n = Readint();
  for (int i = 1, _END_ = n; i <= _END_; i++)
    a[i].first = Readint(), a[i].second = Readint();
  sort(a + 1, a + 1 + n);
  mn = n;
}
void work() {
  int ii;
  int lst;
  for (int i = 1, _END_ = n; i <= _END_; i++) {
    lst =
        lower_bound(a + 1, a + 1 + n, make_pair(a[i].first - a[i].second, 0)) -
        a;
    lst--;
    f[i] = f[lst] + 1;
    mn = min(n - f[i], mn);
  }
  printf("%d\n", mn);
}
int main() {
  int _ = 0;
  init();
  work();
  close();
  return 0;
}
