#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100001];
bool visit[100001];
const int mod = 1000000007;
vector<int> a, b;
int dp[100001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, i, e, f;
  vector<pair<long long, long long> > orig;
  cin >> n;
  for (long long i = 0; i < n; i += 1) cin >> e >> f, orig.push_back({e, f});
  sort(orig.begin(), orig.end());
  for (long long i = 0; i < orig.size(); i += 1)
    a.push_back(orig[i].first), b.push_back(orig[i].second);
  dp[0] = 0;
  for (long long i = 1; i < n; i += 1) {
    if (a[i - 1] < a[i] - b[i])
      dp[i] = dp[i - 1];
    else {
      vector<int>::iterator it =
          lower_bound(a.begin(), a.end(), max(0, a[i] - b[i]));
      int k = it - a.begin();
      if (k == 0)
        dp[i] = i;
      else
        dp[i] = dp[k - 1] + i - k;
    }
  }
  long long ans = INT_MAX;
  for (long long i = 0; i < n; i += 1) ans = min(ans, dp[i] + n - i - 1);
  cout << ans;
  return 0;
}
