#include <bits/stdc++.h>
using namespace std;
pair<int, int> s[100010];
int dp[100010];
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i].first >> s[i].second;
  sort(s, s + n);
  int ans = n;
  for (int i = 0; i < n; i++) {
    int p =
        lower_bound(s, s + n, pair<int, int>(s[i].first - s[i].second, -1)) - s;
    if (p)
      dp[i] = dp[p - 1] + i - p;
    else
      dp[i] = i;
    ans = min(ans, dp[i] + n - i - 1);
  }
  cout << ans << endl;
  return 0;
}
