#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[1000005];
int ans[1000005];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].first >> a[i].second;
  sort(a + 1, a + n + 1);
  ans[1] = 0;
  int mina = 10000000;
  for (int i = 2; i <= n; i++) {
    int l = 1, h = i - 1, mid = (l + h) / 2;
    while (l < h) {
      mid = (l + h) / 2;
      if (a[i].first - a[i].second <= a[mid].first &&
          a[i].first - a[i].second > a[mid - 1].first)
        break;
      if (a[i].first - a[i].second > a[mid].first)
        l = mid + 1;
      else
        h = mid;
    }
    mid = (l + h) / 2;
    if (a[i].first - a[i].second <= a[mid].first) {
      ans[i] = ans[mid - 1] + i - mid;
    } else
      ans[i] = ans[i - 1];
    mina = min(mina, ans[i] + n - i);
  }
  mina = min(mina, n - 1);
  cout << mina;
}
