#include <bits/stdc++.h>
using namespace std;
const int MAXI = 100500;
pair<int, int> v[MAXI];
int n, p, d, DP[MAXI];
int solve(int i) {
  if (i == -1) return 0;
  if (DP[i] != -1) return DP[i];
  int retro =
      lower_bound(v, v + n, make_pair(v[i].first - v[i].second, INT_MIN)) - v;
  int muere = i - retro + solve(retro - 1);
  return DP[i] = muere;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < (int)n; i++) {
    cin >> p >> d;
    v[i] = pair<int, int>(p, d);
  }
  sort(v, v + n);
  int ans = INT_MAX;
  memset(DP, -1, sizeof(DP));
  for (int i = n - 1; i >= 0; i--) {
    ans = min(ans, solve(i) + (n - i - 1));
  }
  cout << ans << '\n';
  return 0;
}
