#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > b, v;
int dp[100000], n;
int solve(int i) {
  int a = i;
  if (i == -1) return 0;
  if (dp[i] != -1) return dp[i];
  int cans = 0;
  int l = v[i].first - v[i].second;
  int p = lower_bound(v.begin(), v.end(), make_pair(l, 0)) - v.begin();
  cans = i - p;
  return dp[a] = cans + solve(p - 1);
}
int main() {
  cin >> n;
  v.resize(n);
  b.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
    dp[i] = -1;
  }
  sort(v.begin(), v.end());
  int ans = 10000000;
  for (int i = 0; i < n; i++) {
    ans = min(ans, i + solve(n - i - 1));
  }
  cout << ans;
  return 0;
}
