#include <bits/stdc++.h>
using namespace std;
bool cmp(long long a, long long b) {
  if (a > b) return true;
  return false;
}
long long n, dp[100010], res;
pair<long long, long long> a[100010];
map<long long, long long> m;
map<long long, long long>::iterator it;
int main() {
  int t = 1;
  while (t--) {
    scanf("%lld", &n);
    for (int i = 0; i < n; i++) {
      scanf("%lld%lld", &a[i].first, &a[i].second);
    }
    sort(a, a + n);
    for (int i = 0; i < n; i++) {
      m[a[i].first] = i;
      it = m.lower_bound(a[i].first - a[i].second);
      if (it == m.begin())
        dp[i] = 1;
      else {
        --it;
        dp[i] = 1 + dp[it->second];
      }
      res = max(dp[i], res);
    }
    cout << n - res << '\n';
  }
  return 0;
}
