#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long double PI = 3.14159265358979323846;
struct myCompare {
  bool operator()(const std::pair<int, int> &l,
                  const std::pair<int, int> &r) const {
    return l.first < r.first;
  }
};
const int MAXN = 1e5 + 3;
std::pair<int, int> b[MAXN];
int n;
int dp[MAXN];
int bSearch(int l, int r, int val) {
  int mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (b[mid].first < val)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return l;
}
void solve() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &b[i].first, &b[i].second);
  }
  sort(b + 1, b + n + 1);
  int res = 1;
  int k;
  dp[1] = 1;
  for (int i = 2; i <= n; ++i) {
    k = bSearch(1, i, b[i].first - b[i].second);
    dp[i] = dp[k - 1] + 1;
    res = max(res, dp[i]);
  }
  cout << n - res;
}
int main() {
  solve();
  return 0;
}
