#include <bits/stdc++.h>
using namespace std;
int total;
struct node {
  int p, l;
  bool operator<(node a) const { return p < a.p; }
} point[100005];
bool operator<(node a, int b) { return a.p < b; }
int main() {
  cin >> total;
  static int dp[100005];
  for (int i = 1; i <= total; i++) cin >> point[i].p >> point[i].l;
  sort(point + 1, point + total + 1);
  int ans = 0;
  for (int i = 1; i <= total; i++) {
    int k = lower_bound(point + 1, point + 1 + total, point[i].p - point[i].l) -
            point;
    dp[i] = dp[k - 1] + 1;
    ans = max(ans, dp[i]);
  }
  cout << total - ans;
}
