#include <bits/stdc++.h>
using namespace std;
struct beacon {
  long long x, p;
};
bool compare(beacon b1, beacon b2) { return b1.x < b2.x; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, i, cur;
  cin >> n;
  beacon a[n];
  long long d[n], total[n];
  for (i = 0; i < n; i++) {
    cin >> a[i].x >> a[i].p;
  }
  sort(a, a + n, compare);
  for (i = 0; i < n; i++) d[i] = a[i].x;
  for (i = 0; i < n; i++) {
    cur = i;
    if (d[cur] - a[cur].p <= a[0].x) {
      total[cur] = cur;
    } else {
      long long pos = lower_bound(d, d + n, d[cur] - a[cur].p) - d;
      total[cur] = (cur - pos);
      if (pos >= 1) total[cur] += (total[pos - 1]);
    }
  }
  long long ans = n;
  for (i = 1; i <= n; i++) {
    ans = min(ans, (n - i) + total[i - 1]);
  }
  cout << ans << "\n";
  return 0;
}
