#include <bits/stdc++.h>
using namespace std;
int n, dp[100005];
struct node {
  int po, le;
} e[100005];
bool cmp(node a, node b) { return a.po < b.po; }
int twice_division(int position, int level) {
  int l = 1, r = n, ans;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (e[mid].po >= position - level) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &e[i].po, &e[i].le);
  }
  int ansn = 2147483647;
  sort(e + 1, e + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    int x = twice_division(e[i].po, e[i].le);
    dp[i] = dp[x - 1] + i - x;
    ansn = min(ansn, dp[i] + n - i);
  }
  printf("%d\n", ansn);
}
