#include <bits/stdc++.h>
using namespace std;
struct Roo {
  long long a, b;
  Roo() { a = b = 0; }
} arr[100010];
long long dp[100010];
bool cmp(Roo a, Roo b) {
  if (a.a < b.a) return 1;
  return 0;
}
long long right(long long l, long long r, long long x) {
  long long m;
  while (l + 1 < r) {
    m = (l + r) / 2;
    if (x < arr[m].a)
      r = m;
    else
      l = m;
  }
  if (x <= arr[l].a) return l;
  return r;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long n, i, ans, r;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> arr[i].a >> arr[i].b;
  }
  sort(arr + 1, arr + 1 + n, cmp);
  ans = 1;
  dp[1] = 1;
  for (i = 2; i <= n; i++) {
    r = right(1, i, arr[i].a - arr[i].b);
    dp[i] = dp[r - 1] + 1;
    ans = max(ans, dp[i]);
  }
  cout << n - ans;
  return 0;
}
