#include <bits/stdc++.h>
using namespace std;
const int INF = int(1e9);
const double EPS = 0.00000000001, PI = 3.14159265358979323846;
const int MAXN = int(1e5 + 100), max_dist = 1000000;
pair<int, int> p[MAXN];
int n;
map<int, int> dp;
int main() {
  int res = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    int a, b;
    scanf("%d %d", &a, &b);
    p[i] = make_pair(a, b);
  }
  sort(p + 1, p + n + 1);
  int c = 1;
  for (int i = 0; i <= max_dist; ++i) {
    if (p[c].first == i)
      dp[i] = dp[i - p[c].second - 1] + 1, c++;
    else
      dp[i] = dp[i - 1];
  }
  for (int i = 1; i <= n; ++i) res = max(res, dp[p[i].first]);
  printf("%d", n - res);
  return 0;
}
