#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[100010];
int n, d[100010];
int bs(int x) {
  int left = 0, right = n;
  while (left <= right) {
    int mid = (left + right) / 2;
    if (p[mid].first <= x)
      left = mid + 1;
    else
      right = mid - 1;
  }
  return (left + right) / 2;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> p[i].first >> p[i].second;
    p[i].first++;
  }
  sort(p + 1, p + n + 1);
  int sol = 0;
  for (int i = 1; i <= n; i++) {
    int k = bs(max(p[i].first - p[i].second - 1, 0));
    d[i] = 1 + d[k];
    sol = max(sol, d[i]);
  }
  cout << n - sol << '\n';
  return 0;
}
