#include <bits/stdc++.h>
using namespace std;
int main() {
  bool DEBUG = 0;
  int n;
  cin >> n;
  vector<pair<int, int> > arr;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    pair<int, int> x;
    x.first = a;
    x.second = b;
    arr.push_back(x);
  }
  sort(arr.begin(), arr.end());
  vector<int> dp(n, 1);
  int m = 0;
  for (int i = 1; i < n; i++) {
    int val = arr[i].first;
    int extent = arr[i].second;
    pair<int, int> temp;
    temp.first = val - extent;
    int index = lower_bound(arr.begin(), arr.end(), temp) - arr.begin();
    if (DEBUG) cout << index << " ";
    if (index == 0) {
      dp[i] = 1;
    } else {
      dp[i] = dp[index - 1] + 1;
    }
    m = max(m, dp[i]);
  }
  m = max(m, dp[0]);
  if (DEBUG) cout << endl;
  if (DEBUG)
    for (int i = 0; i < n; i++) {
      cout << dp[i] << " ";
    }
  if (DEBUG) cout << endl;
  if (DEBUG) cout << m << endl;
  cout << n - m << endl;
}
