#include <bits/stdc++.h>
using namespace std;
long long n;
long long m;
bool comp(vector<int> &a, vector<int> &b) { return a[0] < b[0]; }
void solve() {
  cin >> n;
  vector<vector<int>> a(n);
  vector<int> onlyPos;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    a[i] = {x, y};
  }
  sort(a.begin(), a.end(), comp);
  for (auto &v : a) onlyPos.push_back(v[0]);
  int dp[n];
  dp[0] = 0;
  for (int i = 1; i < n; i++) {
    int find = a[i][0] - a[i][1];
    int pos =
        lower_bound(onlyPos.begin(), onlyPos.end(), find) - onlyPos.begin();
    int blow = 0;
    if (pos < i) {
      blow = i - pos;
    }
    blow += (i - blow - 1 >= 0 ? dp[i - blow - 1] : 0);
    dp[i] = blow;
  }
  int ans = dp[n - 1];
  for (int i = n - 1; i > 0; i--) {
    int curBlowByLast = n - i;
    ans = min(ans, curBlowByLast + dp[i - 1]);
  }
  cout << ans << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  int c = 1;
  while (t--) {
    solve();
    c++;
  }
}
