#include <bits/stdc++.h>
using namespace std;
int arr[100005][2];
int compare(const void *a, const void *b) {
  const unsigned int *arg1 = reinterpret_cast<const unsigned int *>(a);
  const unsigned int *arg2 = reinterpret_cast<const unsigned int *>(b);
  if (arg1[0] > arg2[0]) return 1;
  if (arg1[0] < arg2[0]) return -1;
  return 0;
}
int bs(int target, int n) {
  int low = 0;
  int high = n;
  while (low != high) {
    int mid = (low + high) / 2;
    if (arr[mid][0] <= target) {
      low = mid + 1;
    } else {
      high = mid;
    }
  }
  return low;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i][0]);
    scanf("%d", &arr[i][1]);
  }
  qsort(arr, n, sizeof(arr[0]), compare);
  int dp[n];
  int max;
  int a, ind;
  dp[0] = 1;
  max = 1;
  for (int i = 1; i < n; i++) {
    a = arr[i][0] - arr[i][1];
    ind = bs(a, n);
    ind--;
    if (ind == -1)
      dp[i] = 1;
    else {
      if (arr[ind][0] == a) ind--;
      dp[i] = dp[ind] + 1;
    }
    if (dp[i] > max) max = dp[i];
  }
  cout << n - max << endl;
  return 0;
}
