#include <bits/stdc++.h>
using namespace std;
long long expo(long long a, long long b, long long m) {
  long long result = 1;
  while (b) {
    if (b & 1) {
      result = (result * a) % m;
    }
    b = (b >> 1) % m;
    a = (a * a) % m;
  }
  return result;
}
double expof(double a, int b) {
  double result = 1;
  while (b) {
    if (b & 1) {
      result = (result * a);
    }
    b = (b >> 1);
    a = (a * a);
  }
  return result;
}
int main() {
  int n;
  cin >> n;
  pair<int, int> p[100005];
  for (int i = 0; i < n; ++i) {
    cin >> p[i].first >> p[i].second;
  }
  sort(p, p + n);
  int dp[1000005] = {0}, j = 0;
  for (int i = 0; i <= 1000005; ++i) {
    if (j == 0 && i == p[j].first) {
      dp[i] = 1;
      j++;
    } else if (j == 0 && i < p[j].first)
      dp[i] = 0;
    else if (j == n || p[j].first > i) {
      dp[i] = dp[i - 1];
    } else if (p[j].first == i) {
      if (i - p[j].second - 1 >= 0) {
        dp[i] = dp[i - p[j].second - 1] + 1;
      } else
        dp[i] = 1;
      j++;
    }
  }
  int mx = INT_MIN;
  for (int i = 0; i <= 1000001; ++i) {
    mx = max(mx, dp[i]);
  }
  cout << n - mx << endl;
}
