#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-6;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * (b / (gcd(a, b))); }
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline long long toLL(string s) {
  long long v;
  istringstream sin(s);
  sin >> v;
  return v;
}
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
using namespace std;
long long DP[1000000 + 1];
int N;
vector<pair<long long, long long> > points;
int main() {
  std::ios_base::sync_with_stdio(false);
  memset(DP, 0, sizeof(DP));
  int x, y;
  cin >> N;
  for (int i = 0; i < (int)N; i++) {
    cin >> x >> y;
    points.push_back(make_pair(x, y));
  }
  sort(((points).begin()), ((points).end()));
  for (int k = 0; k < ((int)((points).size())); k++) {
    int val = points[k].first - points[k].second;
    int lo = 0;
    int hi = N - 1;
    int last = -1;
    while (lo <= hi) {
      int mid = lo + (hi - lo) / 2;
      if (points[mid].first < val) {
        last = mid;
        lo = mid + 1;
      } else
        hi = mid - 1;
    }
    DP[k] += last == -1 ? k : max(0, k - last - 1);
    if (last != -1) DP[k] += DP[last];
  }
  long long cnt = 0;
  long long soln = 23112311231223LL;
  for (int i = N - 1; i >= 0; i--) {
    soln = min(soln, DP[i] + cnt);
    cnt++;
  }
  cout << soln << "\n";
}
