#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
int dp[100010][2];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<pair<int, int> > v(n + 1);
  v[0] = make_pair(-0X3f3f3f3f, 0);
  for (long long i = (1); i < (n + 1); ++i) cin >> v[i].first >> v[i].second;
  sort(v.begin(), v.end());
  vector<int> pos(n + 1);
  for (long long i = 0; i < (n + 1); ++i) pos[i] = v[i].first;
  int maxAlive = 0;
  for (long long i = (1); i < (n + 1); ++i) {
    auto it = lower_bound(pos.begin(), pos.end(), v[i].first - v[i].second);
    --it;
    dp[i][0] = 1 + dp[it - pos.begin()][0];
    dp[i][1] = dp[i - 1][0];
    maxAlive = max(maxAlive, max(dp[i][0], dp[i][1]));
  }
  cout << n - maxAlive << '\n';
  return 0;
}
