#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
} sz[200005];
int dp[200005];
int cmp(node a, node b) { return a.x < b.x; }
int ef(int l, int r, int x) {
  int mid, s = 1;
  while (l <= r) {
    mid = (l + r) / 2;
    if (sz[mid].x >= x) {
      s = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return s;
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int i, x, minn = 0x3f3f3f3f, s;
    for (i = 1; i <= n; i++) scanf("%d%d", &sz[i].x, &sz[i].y);
    sort(sz + 1, sz + n + 1, cmp);
    dp[0] = 0;
    for (i = 1; i <= n; i++) {
      x = sz[i].x - sz[i].y;
      s = ef(1, n, x);
      dp[i] = dp[s - 1] + i - s;
      minn = min(minn, dp[i] + n - i);
    }
    printf("%d\n", minn);
  }
  return 0;
}
