#include <bits/stdc++.h>
using namespace std;
long long i, n, b, a, j, l, r, mid, dp[1001000], ans;
pair<long long, long long> p[1001000];
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a >> b;
    p[i] = make_pair(a, b);
  }
  ans = n;
  sort(p + 1, p + 1 + n);
  dp[1] = 0;
  ans = min(ans, dp[1] + (n - 1));
  for (i = 2; i <= n; i++) {
    l = 1;
    r = i;
    while (l < r) {
      mid = (l + r) / 2;
      if (p[i].first - p[i].second > p[mid].first)
        l = mid + 1;
      else
        r = mid;
    }
    dp[i] = i - r + dp[r - 1];
    ans = min(ans, dp[i] + n - i);
  }
  cout << ans;
  return 0;
}
