#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
pair<int, int> p[100005];
int dp[100005][2];
int n;
int find(int x) {
  if (x < 0) return -1;
  int lo = 0, hi = n - 1;
  while (hi - lo >= 1) {
    int mid = lo + (hi - lo + 1) / 2;
    if (p[mid].first >= x)
      hi = mid - 1;
    else
      lo = mid;
  }
  if (p[lo].first < x) return lo;
  return -1;
}
int sol(int x, int y) {
  if (x < 0) return 0;
  if (x == 0) return dp[x][y] = 0;
  if (dp[x][y] != inf) return dp[x][y];
  if (y == 0) {
    int g = 1 + sol(x - 1, y);
    int z = find(p[x].first - p[x].second);
    int h;
    if (z == -1)
      h = x;
    else
      h = (x - z - 1) + sol(z, !y);
    return dp[x][y] = min(g, h);
  }
  if (y == 1) {
    int z = find(p[x].first - p[x].second);
    int h;
    if (z == -1)
      return dp[x][y] = x;
    else
      return dp[x][y] = (x - z - 1) + sol(z, y);
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p[i].first >> p[i].second;
  sort(p, p + n);
  for (int i = 0; i < 100005; i++)
    for (int j = 0; j < 2; j++) dp[i][j] = inf;
  cout << min(sol(n - 1, 0), sol(n - 1, 1)) << " \n";
  return 0;
}
