#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[100005];
int dp[100005];
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p[i].first >> p[i].second;
  sort(p, p + n);
  int ans = 1;
  for (int i = 0; i < n; i++) {
    int lo = -1, hi = n;
    int r = p[i].first - p[i].second;
    while (hi - lo > 1) {
      int mid = lo + (hi - lo + 1) / 2;
      if (p[mid].first >= (r))
        hi = mid;
      else
        lo = mid;
    }
    if (lo == -1)
      dp[i] = 1;
    else
      dp[i] = dp[lo] + 1;
    ans = max(ans, dp[i]);
  }
  cout << n - ans << '\n';
  return 0;
}
