#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 1, 0, 0, 0, 0, 0, 0};
int dy[] = {0, 0, 1, -1, 0, 0, 0, 0};
const long long inf = 1000000007;
const double eps = 0.000000009;
long long mod = 1000000007;
bool comp(int a, int b) { return abs(a) < abs(b); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  map<long long, long long> a;
  for (int i = 0; i < n; i++) {
    long long t1, t2;
    cin >> t1 >> t2;
    a[t1] = t2;
  }
  map<long long, long long>::iterator it = a.begin(), it1;
  map<long long, long long> dp;
  dp[(*(a.begin())).first] = 1;
  long long ans = 1;
  for (it; it != a.end(); it++) {
    pair<long long, long long> x = *it;
    if ((*(a.begin())).first < x.first - x.second) {
      it1 = a.lower_bound(x.first - x.second);
      it1--;
      dp[x.first] = 1 + dp[(*it1).first];
      ans = max(ans, dp[x.first]);
    } else {
      dp[x.first] = 1;
    }
  }
  cout << n - ans << endl;
  return 0;
}
