#include <bits/stdc++.h>
struct node {
  int postion;
  int power;
};
node a[100005];
int dp[100005];
int b[100005];
using namespace std;
int cmp(node x, node y) { return x.postion < y.postion; }
int main() {
  int i, j, n, k, ans;
  ans = -1;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i].postion >> a[i].power;
  sort(a, a + n, cmp);
  dp[0] = 1;
  ans = 1;
  for (i = 0; i < n; i++) b[i] = a[i].postion;
  for (i = 1; i < n; i++) {
    j = a[i].postion - a[i].power;
    k = lower_bound(b, b + i + 1, j) - b;
    if (k == 0)
      dp[i] = 1;
    else
      dp[i] = dp[k - 1] + 1;
    if (dp[i] > ans) ans = dp[i];
  }
  cout << n - ans << endl;
  return 0;
}
