#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
istream &operator>>(istream &is, vector<pair<T1, T2>> &v) {
  for (pair<T1, T2> &t : v) is >> t.first >> t.second;
  return is;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &t : v) is >> t;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (const T &t : v) {
    os << t << " ";
  }
  os << '\n';
  return os;
}
double pi = acos(-1.0);
const long long md = 1e9 + 7;
const long long INF = 1e15;
long long dx1[] = {0, 0, -1, 1};
long long dy1[] = {1, -1, 0, 0};
template <class T>
T abst(T a) {
  return a < 0 ? -a : a;
}
template <class T>
T max2(T a, T b) {
  return a > b ? a : b;
}
template <class T>
T min2(T a, T b) {
  return a < b ? a : b;
}
long long n;
vector<pair<long long, long long>> v;
vector<long long> vt;
long long dp[1000001];
long long fun(long long ind) {
  if (ind <= 0) return 0;
  if (dp[ind] != -1) return dp[ind];
  long long x = v[ind].first - v[ind].second;
  long long y = lower_bound((vt).begin(), (vt).end(), x) - vt.begin();
  y--;
  return dp[ind] = max2(0LL, ind - y - 1) + fun(y);
}
void solve() {
  cin >> n;
  v.resize(n);
  cin >> v;
  sort((v).begin(), (v).end());
  for (pair<long long, long long> p : v) vt.push_back(p.first);
  memset(dp, -1, sizeof(dp));
  long long ans = n;
  for (long long i = n - 1; i >= 0; i--) ans = min2(ans, n - 1 - i + fun(i));
  cout << ans;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  for (long long i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
