#include <bits/stdc++.h>
using namespace std;
void print_vector(vector<int> v);
void print_array(int* array, int start, int end);
vector<pair<int, int> > towers;
int n, a, b;
int sol[100100];
int solve(int i) {
  if (i < 0)
    return 0;
  else if (i == 0)
    return 1;
  else if (sol[i] != -1)
    return sol[i];
  else {
    auto left =
        lower_bound((towers).begin(), (towers).end(),
                    pair<int, int>(towers[i].first - towers[i].second, -1));
    return sol[i] = 1 + solve(left - towers.begin() - 1);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = (0), _b = (n); i < _b; i++) {
    cin >> a >> b;
    towers.push_back(pair<int, int>(a, b));
  }
  sort((towers).begin(), (towers).end());
  memset(sol, -1, sizeof sol);
  for (int i = (0), _b = (n); i < _b; i++) {
    sol[i] = solve(i);
  }
  int ans = n;
  for (int i = (0), _b = (n); i < _b; i++) {
    ans = min(ans, (i + 1) - sol[i] + n - i - 1);
  }
  cout << ans << endl;
  return 0;
}
void print_array(int* array, int start, int end) {
  printf("[");
  for (int i = (start), _b = (end); i < _b; i++) {
    printf("%d ", array[i]);
  }
  printf("]");
  printf("\n");
}
void print_vector(vector<int> v) {
  printf("[");
  for (int i = (0), _b = (v.size()); i < _b; i++) {
    printf("%d ", v[i]);
  }
  printf("]");
  printf("\n");
}
