#include <bits/stdc++.h>
using namespace std;
const int INF = numeric_limits<int>::max();
const long long LLINF = numeric_limits<long long>::max();
const unsigned long long ULLINF = numeric_limits<unsigned long long>::max();
int dp[100100];
vector<pair<int, int>> s;
int bin(int l, int r, int v) {
  int res = -1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (s[mid].first >= v)
      r = mid - 1;
    else
      res = mid, l = mid + 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  s.resize(n);
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    s[i] = {a, b};
  }
  sort((s).begin(), (s).end());
  for (int i = 0; i < n; i++) {
    int next = bin(0, i - 1, s[i].first - s[i].second);
    if (next == -1)
      dp[i] = i;
    else
      dp[i] = dp[next] + i - next - 1;
  }
  int ans = INF;
  for (int i = 0; i < n; i++) ans = min(ans, dp[i] + n - i - 1);
  cout << ans;
  return 0;
}
