#include <bits/stdc++.h>
using namespace std;
long long int find(long long int l, long long int r, long long int x,
                   vector<pair<long long int, long long int> > &a) {
  if (l == r) return l;
  if (l < r) {
    long long int mid = (l + r) / 2;
    if (a[mid].first >= x)
      return find(l, mid - 1, x, a);
    else if (a[mid].first < x) {
      if (mid == r)
        return r;
      else {
        if (a[mid + 1].first < x)
          return find(mid + 1, r, x, a);
        else
          return mid;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  vector<pair<long long int, long long int> > a(n);
  for (long long int i = 0; i < n; i++) {
    long long int temp1, temp2;
    cin >> temp1 >> temp2;
    a[i].first = temp1, a[i].second = temp2;
  }
  sort(a.begin(), a.end());
  vector<long long int> desa(n, 0);
  vector<long long int> desb(n, 0);
  desa[0] = n - 1;
  desb[0] = 0;
  long long int ans = desa[0] + desb[0];
  for (long long int i = 1; i < n; i++) {
    desa[i] = n - i - 1;
    long long int count = 0;
    long long int current = i - 1;
    if (a[0].first >= a[i].first - a[i].second)
      current = -1;
    else {
      long long int p = find(0, i - 1, a[i].first - a[i].second, a);
      count = i - p - 1;
      current = p;
    }
    if (current < 0)
      desb[i] = i;
    else
      desb[i] = count + desb[current];
    if (desb[i] + desa[i] < ans) ans = desb[i] + desa[i];
  }
  cout << ans << endl;
  return 0;
}
