#include <bits/stdc++.h>
using namespace std;
long long nx2(long long n) {
  long long p = 1;
  if (n && !(n & (n - 1))) return n;
  while (p < n) p <<= 1;
  return p;
}
namespace Debug {
void dout() { cerr << "\n"; }
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
  cerr << " " << H;
  dout(T...);
}
template <typename T>
void douta(const T *a, int n) {
  cerr << "\n[";
  for (int i = 0; i < n; i++) {
    cerr << " " << a[i];
  }
  cerr << " ]\n";
}
template <typename T>
void doutaa(T **b, int r, int c) {
  for (int i = 0; i < r; i++) {
    cerr << "[";
    for (int j = 0; j < c; j++) {
      cerr << " " << b[i][j];
    }
    cerr << " ]\n";
  }
}
template <typename T>
void dout(const vector<T> v) {
  cerr << "\n[";
  for (T i : v) {
    cerr << " " << i;
  }
  cerr << " ]\n";
}
template <typename T>
void dout(const vector<vector<T>> v) {
  cerr << "\n";
  for (vector<T> u : v) {
    cerr << "[";
    for (T i : u) {
      cerr << " " << i;
    }
    cerr << " ]\n";
  }
}
template <typename F, typename S>
void dout(const vector<pair<F, S>> u) {
  cerr << "\n";
  for (pair<F, S> v : u) {
    cerr << "[ " << v.first << " " << v.second << " ]\n";
  }
}
}  // namespace Debug
using namespace Debug;
int n;
vector<pair<int, int>> a;
vector<int> initial;
int binsearch(int x, int r) {
  int l = 0, m;
  while (l < r) {
    m = l + (r - l + 1) / 2;
    if (a[m].first < x) {
      l = m;
    } else {
      r = m - 1;
    }
  }
  return (a[l].first < x) ? l : -1;
}
int main() {
  cin >> n;
  a.assign(n, make_pair(0, 0)), initial.assign(n, 1);
  int ans;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      ans = 1;
      continue;
    }
    int safei = binsearch(a[i].first - a[i].second, i);
    if (safei != -1) {
      initial[i] = initial[safei] + 1;
    }
    (ans) = max((ans), (initial[i - 1]));
    ;
  }
  (ans) = max((ans), (initial[n - 1]));
  ;
  cout << n - ans << '\n';
}
