#include <bits/stdc++.h>
using namespace std;
int dp[100001];
int tmp, n, b[100001];
vector<pair<int, int> > a;
int main() {
  int tt, ss;
  cin >> n;
  for (int i = (0); i <= (n - 1); i++) {
    cin >> tt >> ss;
    a.push_back(make_pair(tt, ss));
  }
  sort(a.begin(), a.end());
  tmp = 0;
  int mn = INT_MIN;
  for (int i = (0); i <= (n - 1); i++) {
    int lb = lower_bound(a.begin(), a.end(),
                         make_pair(a[i].first - a[i].second, 0)) -
             a.begin();
    dp[i] = dp[lb - 1] + 1;
    mn = max(mn, dp[i]);
  }
  cout << n - mn << endl;
  return 0;
}
