#include <bits/stdc++.h>
using namespace std;
int n, dp[100005], res = 1000000, T[100005];
vector<pair<int, int> > V;
int main() {
  scanf("%d", &n);
  T[0] = -1000000000;
  for (int i = 1; i <= n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    V.push_back(make_pair(a, b));
  }
  sort(V.begin(), V.end());
  for (int i = 1; i <= n; i++) {
    int a = V[i - 1].first, b = V[i - 1].second;
    T[i] = a;
    int p = 0, k = i - 1, mid = (p + k) / 2, r = i;
    while (p <= k) {
      if (T[mid] >= a - b) {
        r = min(r, mid);
        k = mid - 1;
      } else
        p = mid + 1;
      mid = (p + k) / 2;
    }
    dp[i] = dp[r - 1] + i - r;
    res = min(res, dp[i] + n - i);
  }
  printf("%d\n", res);
  return 0;
}
