#include <bits/stdc++.h>
using namespace std;
long long dp[1 << 20];
long long mark[1 << 20];
pair<long long, long long> p[1 << 20];
int main() {
  long long n;
  scanf("%I64d", &n);
  for (long long i = 0; i < n; i++) {
    long long a, b;
    scanf("%I64d %I64d", &p[i].first, &p[i].second);
    mark[p[i].first] = i + 1;
  }
  sort(p, p + n);
  long long cnt = 0;
  for (long long i = 0; i <= 1000000; i++) {
    if (mark[i]) {
      mark[i] = cnt;
      cnt++;
    } else {
      mark[i] = cnt;
    }
  }
  long long mx = -1;
  dp[0] = 0;
  for (long long i = 0; i < n; i++) {
    if (dp[mark[max(p[i].first - p[i].second, 0ll)]] + 1 > mx) {
      mx = dp[mark[max(p[i].first - p[i].second, 0ll)]] + 1;
    }
    dp[i + 1] = dp[mark[max(p[i].first - p[i].second, 0ll)]] + 1;
  }
  printf("%I64d", n - mx);
}
