#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int dp[N];
struct point {
  int a, b;
  point(int _a = 0, int _b = 0) {
    a = _a;
    b = _b;
  }
} p[N];
bool comp(point a, point b) { return a.a < b.a; }
int find(int l, int r, int x) {
  int ans = 0;
  int mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (p[mid].a >= x)
      r = mid - 1;
    else {
      l = mid + 1;
      ans = mid;
    }
  }
  return ans;
}
int main() {
  int n, ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &p[i].a, &p[i].b);
  }
  sort(p + 1, p + n + 1, comp);
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    int x = find(1, i, p[i].a - p[i].b);
    dp[i] = dp[x] + 1;
    ans = max(ans, dp[i]);
  }
  printf("%d\n", n - ans);
  return 0;
}
