#include <bits/stdc++.h>
using namespace std;
int a2[100009];
int main() {
  vector<int> arr;
  vector<pair<int, int> > a1;
  map<int, int> mp;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    a1.push_back(make_pair(x, y));
  }
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  sort(a1.begin(), a1.end());
  for (int i = 0; i < n; i++) {
    mp[i] = a1[i].second;
    arr.push_back(a1[i].first);
  }
  int ans1 = n + 10;
  for (int i = n - 1; i >= 0; i--) {
    int k = lower_bound(arr.begin(), arr.end(), max(0, a1[i].first - mp[i])) -
            arr.begin();
    a2[i] += (i - k);
  }
  for (int i = 1; i < n; i++) {
    if (i - a2[i] - 1 > 0) a2[i] += a2[i - a2[i] - 1];
  }
  int mx = 0, kk = 0;
  for (int i = n - 1; i >= 0; i--) {
    kk = 0;
    if (i - 1 > 0) kk = a2[i - 1];
    ans1 = min(ans1, min(mx + kk + 1, mx + a2[i]));
    mx++;
  }
  cout << ans1 << "\n";
}
