#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  vector<pair<int, int> > temp(n);
  for (int i = 0; i < n; i += 1) cin >> temp[i].first >> temp[i].second;
  sort(temp.begin(), temp.end());
  for (int i = 0; i < n; i += 1) a[i] = temp[i].first, b[i] = temp[i].second;
  vector<int> v(n);
  for (int i = 1; i < n; i += 1) {
    auto it = lower_bound(a.begin(), a.end(), a[i] - b[i]);
    v[i] = i - (it - a.begin());
  }
  for (int i = 1; i < n; i += 1)
    v[i] += (i - v[i] - 1 >= 0 ? v[i - v[i] - 1] : 0);
  int ans = v[n - 1];
  for (int i = n - 1; i >= 1; i -= 1) ans = min(ans, n - i + v[i - 1]);
  cout << ans;
}
