#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> c[10000010];
int a[1000010];
int b[1000010];
int dp[1000010][2];
int solve(int i, bool dd) {
  if (i == -1) return 0;
  if (dp[i][dd] == -1) {
    int dis = a[i] - b[i];
    int j = lower_bound(a, a + n, dis) - a - 1;
    if (dd) {
      dp[i][dd] = max(1 + solve(j, 0), solve(i - 1, 1));
    } else {
      dp[i][dd] = 1 + solve(j, 0);
    }
  }
  return dp[i][dd];
}
int main() {
  memset(dp, -1, sizeof(dp));
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &c[i].first, &c[i].second);
  }
  sort(c, c + n);
  for (int i = 0; i < n; i++) {
    a[i] = c[i].first;
    b[i] = c[i].second;
  }
  int ans = solve(n - 1, 1);
  cout << n - ans << endl;
  return 0;
}
