#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
vector<long long int> x;
vector<long long int> d;
vector<long long int> net;
long long int sum_net(long long int index) {
  if (index == -1) return 0;
  if (net[index] != -1) return net[index];
  auto it = lower_bound(x.begin(), x.end(), x[index] - (d[index]));
  if (it == x.begin()) return net[index] = index;
  long long int new_index = index - (it - x.begin());
  it--;
  return net[index] = new_index + sum_net(it - x.begin());
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  x.clear();
  d.clear();
  vector<pair<long long int, long long int> > temp;
  for (int i = (int)0; i < (int)n; i++) {
    long long int a, b;
    cin >> a >> b;
    temp.push_back(make_pair(a, b));
  }
  sort(temp.begin(), temp.end());
  for (int i = (int)0; i < (int)n; i++) {
    x.push_back(temp[i].first);
    d.push_back(temp[i].second);
  }
  net.clear();
  net.reserve(n);
  for (long long int i = 0; i < n; i++) net[i] = -1;
  for (long long int i = n - 1; i >= 0; i--)
    if (net[i] == -1) net[i] = sum_net(i);
  long long int m = LLONG_MAX;
  for (long long int i = n - 1; i >= 0; i--)
    m = std::min(net[i] + n - 1 - i, m);
  cout << m << '\n';
  return 0;
}
