#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
using namespace chrono;
long long int advceil(long long int num, long long int den) {
  return (num % den == 0 ? num / den : num / den + 1);
}
long long int lstbt(long long int val) {
  long long int msk = val & (val - 1);
  return log2(val ^ msk);
}
long long int expo(long long int a, long long int b) {
  long long int res = 1;
  while (b > 0) {
    if (b & 1) res = (res % 1000000007 * a % 1000000007) % 1000000007;
    a = (a % 1000000007 * a % 1000000007);
    b /= 2;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  return a == 0 ? b : gcd(b % a, a);
}
vector<pair<long long int, long long int> > arr;
long long int dp[300001][3];
long long int Dfn(long long int idx, bool isgameStarted) {
  if (idx < 0)
    return 0;
  else if (dp[idx][isgameStarted] != -1)
    return dp[idx][isgameStarted];
  long long int c1 = 0, c2 = 0;
  if (isgameStarted) {
    c1 = idx - arr[idx].second + Dfn(arr[idx].second - 1, isgameStarted);
    return dp[idx][isgameStarted] = c1;
  }
  c1 = idx - arr[idx].second + Dfn(arr[idx].second - 1, true);
  c2 = 1 + Dfn(idx - 1, isgameStarted);
  return dp[idx][isgameStarted] = min(c1, c2);
}
void solve() {
  long long int n;
  cin >> n;
  arr.resize(n);
  for (long long int i = 0; i < n; i++) cin >> arr[i].first >> arr[i].second;
  sort(arr.begin(), arr.end());
  for (long long int i = arr.size() - 1; i >= 0; i--) {
    pair<long long int, long long int> temp =
        make_pair(arr[i].first - arr[i].second, -1999999996000000010);
    auto itr = lower_bound(arr.begin(), arr.end(), temp) - arr.begin();
    arr[i].second = itr;
  }
  memset(dp, -1, sizeof(dp));
  cout << Dfn(n - 1, 0) << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  auto start1 = high_resolution_clock::now();
  solve();
  auto stop1 = high_resolution_clock::now();
  auto duration = duration_cast<microseconds>(stop1 - start1);
}
