#include <bits/stdc++.h>
using namespace std;
struct P {
  int pos;
  int dis;
};
bool cmp(P a, P b) { return a.pos < b.pos; }
P k[100005];
int a[100005];
int d[100005];
int dp[100005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &k[i].pos, &k[i].dis);
  sort(k + 1, k + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    a[i] = k[i].pos;
    d[i] = k[i].dis;
  }
  dp[0] = 0;
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    int pos = lower_bound(a + 1, a + i + 1, a[i] - d[i]) - a - 1;
    dp[i] = dp[pos] + 1;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) ans = max(ans, dp[i]);
  printf("%d\n", n - ans);
}
