#include <bits/stdc++.h>
using namespace std;
const int MXL = 0x3f3f3f3f;
const int mxn = 100006;
int N;
pair<int, int> a[mxn];
int f[mxn];
void EXEC() {
  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);
  a[0].first = -MXL;
  f[0] = 0;
  int ans = 0;
  for (int i = 1; i <= N; ++i) {
    int L = 0, R = i - 1, M;
    while (L < R)
      if (a[M = L + R + 1 >> 1].first < a[i].first - a[i].second)
        L = M;
      else
        R = M - 1;
    f[i] = f[L] + 1;
    ans = max(ans, f[i]);
  }
  printf("%d\n", N - ans);
}
int main() {
  EXEC();
  return 0;
}
