#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
struct node {
  int a, b;
} v[N];
int x[N], dp[N];
bool cmp(node t1, node t2) { return t1.a < t2.a; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &v[i].a, &v[i].b);
  }
  sort(v + 1, v + n + 1, cmp);
  for (int i = 1; i <= n; i++) x[i] = v[i].a;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int pos = lower_bound(x + 1, x + n + 1, v[i].a - v[i].b) - x;
    dp[i] = dp[pos - 1] + 1;
    ans = max(ans, dp[i]);
  }
  printf("%d\n", n - ans);
  return 0;
}
