#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
pair<int, int> p[maxn];
vector<int> v;
int n;
int dp[maxn];
int main() {
  cin >> n;
  v.push_back(-1);
  for (int i = 1; i <= n; i++) {
    cin >> p[i].first >> p[i].second;
    v.push_back(p[i].first);
  }
  sort(p + 1, p + n + 1);
  sort(v.begin(), v.end());
  dp[1] = 1;
  int ans = 1;
  for (int i = 2; i <= n; i++) {
    int d = p[i].first - p[i].second;
    if (d <= 0)
      dp[i] = 1;
    else {
      int t = (lower_bound(v.begin(), v.end(), d) - v.begin() - 1);
      dp[i] = dp[t] + 1;
    }
    ans = max(ans, dp[i]);
  }
  cout << n - ans << endl;
  return 0;
}
