#include <bits/stdc++.h>
using namespace std;
struct State {
  int p;
  int v;
};
State state[100000];
static int dp[100000];
bool cmp_state(const State &s1, const State &s2) { return s1.p < s2.p; }
int calc(int end) {
  if (end <= 0) return 0;
  if (dp[end] != -1) return dp[end];
  State f;
  f.p = state[end].p - state[end].v;
  int idx = lower_bound(state, state + end + 1, f, cmp_state) - state;
  if (idx == end + 1)
    dp[end] = end;
  else {
    if (state[idx].p >= f.p) idx--;
    dp[end] = calc(idx) + end - idx - 1;
  }
  return dp[end];
}
int comb(int end) {
  if (!end) return 0;
  int min = end;
  for (int i = end - 1; i >= 0; i--) {
    int cur = calc(i) + end - i - 1;
    if (cur < min) min = cur;
  }
  return min;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> state[i].p >> state[i].v;
    dp[i] = -1;
  }
  sort(state, state + n, cmp_state);
  cout << comb(n) << endl;
  return 0;
}
