#include <bits/stdc++.h>
using namespace std;
const int INF = (int)(INT_MAX - 100);
const long long mod = (int)(1e+9 + 7);
const int N = (int)(0);
int main() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  map<int, int> b;
  int x;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a[i], &x);
    b[a[i]] = x;
  }
  sort(a.begin(), a.end());
  vector<int> dp(n + 1);
  int cnt1, cnt2, m = n;
  for (int i = (1); i <= (n); i++) {
    cnt1 =
        lower_bound(a.begin() + 1, a.begin() + i + 1, a[i]) - (a.begin() + 1);
    cnt2 = lower_bound(a.begin() + 1, a.begin() + i + 1, a[i] - b[a[i]]) -
           (a.begin() + 1);
    dp[i] = cnt1 - cnt2 + dp[cnt2];
    m = min(m, dp[i] + n - i);
  }
  cout << m;
  return 0;
}
