#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > beacon;
int dp[100006];
int binsearch(int l, int r, int z) {
  int mid = (l + r) / 2;
  if (beacon[mid].first < z) {
    if (beacon[mid + 1].first >= z) {
      return mid;
    } else {
      return binsearch(mid + 1, r, z);
    }
  }
  return binsearch(l, mid, z);
}
int solve(int n) {
  dp[0] = 0;
  dp[1] = 0;
  for (int i = 2; i <= n; ++i) {
    int k = binsearch(0, i + 1, beacon[i].first - beacon[i].second);
    dp[i] = dp[k] + (i - (k + 1));
  }
  int cnt = 1;
  int ans = dp[n];
  for (int i = n; i >= 1; --i) {
    ans = min(ans, cnt + dp[i - 1]);
    cnt++;
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  beacon.push_back(make_pair(-100000000, 0));
  for (int i = 1; i <= n; ++i) {
    int b, p;
    scanf("%d %d", &b, &p);
    beacon.push_back(make_pair(b, p));
  }
  sort(beacon.begin(), beacon.end());
  cout << solve(n) << "\n";
  return 0;
}
