#include <bits/stdc++.h>
using namespace std;
const long long int Mod = 1e9 + 7;
const long long int Inf = 0x7fffffff;
int num[1000025];
pair<int, int> bombs[1000025];
int Bsearch(int value, int start, int end) {
  int mid, Ans;
  if (bombs[end].first < value) {
    return end + 1;
  }
  while (start <= end) {
    mid = (start + end) / 2;
    if (bombs[mid].first == value) {
      Ans = mid;
      break;
    } else if (bombs[mid].first > value) {
      if (mid > 0) {
        if (bombs[mid - 1].first < value) {
          Ans = mid;
          break;
        }
      } else {
        Ans = mid;
        break;
      }
      end = mid - 1;
    } else if (bombs[mid].first < value) {
      start = mid + 1;
    }
  }
  return Ans;
}
int generate_num(int index) {
  int cover = Bsearch(bombs[index].second, 0, index - 1);
  if (cover > 0) {
    return (index - cover) + num[cover - 1];
  } else {
    return (index - cover);
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int N, temp, min_dest = Inf, fin_ind;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> bombs[i].first >> temp;
    bombs[i].second = max(0, bombs[i].first - temp);
  }
  sort(bombs, bombs + N);
  num[0] = 0;
  for (int i = 1; i < N; ++i) {
    num[i] = generate_num(i);
  }
  for (int i = 0; i < N; ++i) {
    if (min_dest > num[i] + (N - 1 - i)) {
      min_dest = num[i] + (N - 1 - i);
      fin_ind = i;
    }
  }
  cout << min_dest << endl;
  return 0;
}
