#include <bits/stdc++.h>
const int MAX = 1e5 + 11;
using namespace std;
const int MOD = (const int)(1e9 + 7);
const int INF = (const int)1e9;
int64_t S[MAX];
static void solve(int test) {
  memset(S, 0, sizeof(S));
  int N = 0;
  scanf("%d", &N);
  vector<pair<int, int>> all;
  for (int i = 0; i < N; ++i) {
    int x = 0, y = 0;
    scanf("%d %d", &x, &y);
    all.push_back({x, y});
  }
  sort(all.begin(), all.end());
  vector<int> cnt;
  cnt.push_back(0);
  for (int i = 1; i < all.size(); ++i) {
    auto cmp = [&](const pair<int, int> &a, const int &b) {
      return a.first < b;
    };
    int lhs = all[i].first - all[i].second;
    int j = (int)(lower_bound(all.begin(), all.begin() + i, lhs, cmp) -
                  all.begin());
    cnt.push_back(i - j);
  }
  for (int i = 0; i < N; ++i) {
    S[i + 1] = S[i - cnt[i]] + cnt[i];
  }
  int64_t res = INF;
  for (int i = 0; i <= N; ++i) {
    res = min(res, i + S[N - i]);
  }
  cout << res;
}
int main() {
  solve(0);
  return 0;
}
