#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 1e18;
const int N = 1021234;
int n;
struct Node {
  int a, b;
} cow[N];
bool cmp(Node A, Node B) { return A.a < B.a; }
int dp[N];
int main() {
  while (scanf("%d", &n) != EOF) {
    int i, j;
    for (i = 0; i < n; ++i) {
      scanf("%d%d", &cow[i].a, &cow[i].b);
      dp[i] = 1;
    }
    sort(cow, cow + n, cmp);
    int ans = 1;
    for (i = 0; i < n; ++i) {
      int l = 0, r = n - 1;
      int x = cow[i].a - cow[i].b;
      while (l <= r) {
        int mid = (l + r) >> 1;
        if (cow[mid].a < x)
          l = mid + 1;
        else
          r = mid - 1;
      }
      if (r < 0 || r >= n) continue;
      dp[i] = dp[r] + 1;
      ans = max(dp[i], ans);
    }
    printf("%d\n", n - ans);
  }
}
