#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int n;
  cin >> n;
  vector<pair<int, int>> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first >> a[i].second;
  }
  a.push_back({-20000000, 0});
  sort((a).begin(), (a).end());
  int ans = n;
  vector<int> dp(n + 1);
  dp[0] = 0;
  for (int i = 1; i <= n; ++i) {
    int j = lower_bound((a).begin(), (a).end(),
                        pair<int, int>{a[i].first - a[i].second, -1}) -
            a.begin() - 1;
    dp[i] = dp[j] + i - j - 1;
    0;
  }
  for (int i = 1; i <= n; ++i) {
    ans = min(ans, n - i + dp[i]);
  }
  cout << ans << endl;
  return 0;
}
