#include <bits/stdc++.h>
using namespace std;
int n, mx;
pair<int, int> yo[100005];
int dp[100005];
int a, b, ans;
int boom[100005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &a, &b);
    yo[i] = make_pair(a, b);
  }
  sort(yo, yo + n);
  for (int i = 1; i <= n; i++) boom[i] = yo[i - 1].first;
  dp[1] = 1;
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    int rng = yo[i - 1].first - yo[i - 1].second;
    int pd = lower_bound(boom + 1, boom + 1 + n, rng) - boom;
    dp[i] = 1 + dp[pd - 1];
  }
  for (int i = 1; i <= n; i++) {
    ans = max(ans, dp[i]);
  }
  cout << n - ans;
  return 0;
}
