#include <bits/stdc++.h>
using namespace std;
const int inf = 2e9;
const int N = 1e6 + 11;
const int mod = 1e9 + 7;
int f[N];
pair<int, int> a[N];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  sort(a, a + n);
  for (int i = 1; i < n; i++) {
    int l = -1, r = i, left = a[i].first - a[i].second;
    while (r - l > 1) {
      int m = (l + r) >> 1;
      if (a[m].first < left)
        l = m;
      else
        r = m;
    }
    f[i] = i - r + (r ? f[r - 1] : 0);
  }
  int res = n;
  for (int i = 1; i <= n; i++) {
    res = min(f[i - 1] + n - i, res);
  }
  cout << res;
  return 0;
}
