#include <bits/stdc++.h>
int find_unreached(std::vector<std::tuple<int, int>> &beacons, int pos,
                   int search) {
  int low = 0;
  int high = pos;
  if (search <= std::get<0>(beacons[0])) return -1;
  while (high - low > 1) {
    int mid = (low + high) / 2;
    int comppos = std::get<0>(beacons[mid]);
    if (comppos == search) {
      return mid - 1;
    } else if (comppos < search) {
      low = mid;
    } else {
      high = mid;
    }
  }
  return low;
}
int main() {
  int n;
  std::cin >> n;
  std::vector<std::tuple<int, int>> beacons;
  int dp[n];
  dp[0] = 1;
  for (int i = 0; i < n; i++) {
    int pos;
    int pow;
    std::cin >> pos >> pow;
    beacons.push_back(std::make_tuple(pos, pos - pow));
  }
  std::sort(beacons.begin(), beacons.end());
  int best = 1;
  for (int i = 1; i < n; i++) {
    int prev = find_unreached(beacons, i, std::get<1>(beacons[i]));
    if (prev == -1) {
      dp[i] = 1;
    } else {
      dp[i] = dp[prev] + 1;
    }
    if (dp[i] > best) {
      best = dp[i];
    }
  }
  std::cout << n - best << std::endl;
}
