#include <bits/stdc++.h>
using namespace std;
struct edge {
  int u, v;
  long long w;
};
long long MOD = 1000000007;
long long _MOD = 1000000009;
double EPS = 1e-10;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > ab(n);
  for (int i = 0; i < n; i++) cin >> ab[i].first >> ab[i].second;
  sort(ab.begin(), ab.end());
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) {
    a[i] = ab[i].first;
    b[i] = ab[i].second;
  }
  vector<int> dp(n + 1);
  for (int i = 0; i < n; i++) {
    int j = lower_bound(a.begin(), a.end(), a[i] - b[i]) - a.begin();
    dp[i + 1] = dp[j] + 1;
  }
  int ma = 0;
  for (int i = 0; i <= n; i++) ma = max(ma, dp[i]);
  cout << n - ma << endl;
}
