#include <bits/stdc++.h>
using namespace std;
const int inf = 2147483647;
const long long linf = 9223372036854775807;
const double Pi = 3.141592653589793;
const int mod = 1000000007;
bool scan(int &x) {
  register char ch = getchar();
  register bool b = 0;
  if (ch == EOF) return 0;
  while (ch == ' ' || ch == 10 || ch == 11 || ch == 14) {
    ch = getchar();
  }
  if (ch == EOF) return 0;
  if (ch < '0' && ch > '9' && ch != '-') return 0;
  if (ch == '-') {
    b = 1;
    ch = getchar();
    if (ch == EOF) return 0;
  }
  if (ch < '0' || ch > '9') return 0;
  x = 0;
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  x *= (b ? -1 : 1);
  return 1;
}
bool scan(long long &x) {
  register char ch = getchar();
  register bool b = 0;
  if (ch == EOF) return 0;
  while (ch == ' ' || ch == 10 || ch == 11 || ch == 14) {
    ch = getchar();
  }
  if (ch == EOF) return 0;
  if (ch < '0' && ch > '9' && ch != '-') return 0;
  if (ch == '-') {
    b = 1;
    ch = getchar();
    if (ch == EOF) return 0;
  }
  if (ch < '0' || ch > '9') return 0;
  x = 0;
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  x *= (b ? -1 : 1);
  return 1;
}
bool scan(unsigned long long &x) {
  register char ch = getchar();
  register bool b = 0;
  if (ch == EOF) return 0;
  while (ch == ' ' || ch == 10 || ch == 11 || ch == 14) {
    ch = getchar();
  }
  if (ch == EOF) return 0;
  if (ch < '0' && ch > '9' && ch != '-') return 0;
  if (ch == '-') {
    b = 1;
    ch = getchar();
    if (ch == EOF) return 0;
  }
  if (ch < '0' || ch > '9') return 0;
  x = 0;
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  x *= (b ? -1 : 1);
  return 1;
}
bool scan(unsigned &x) {
  register char ch = getchar();
  register bool b = 0;
  if (ch == EOF) return 0;
  while (ch == ' ' || ch == 10 || ch == 11 || ch == 14) {
    ch = getchar();
  }
  if (ch == EOF) return 0;
  if (ch < '0' && ch > '9' && ch != '-') return 0;
  if (ch == '-') {
    b = 1;
    ch = getchar();
    if (ch == EOF) return 0;
  }
  if (ch < '0' || ch > '9') return 0;
  x = 0;
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  x = (b ? -1 : 1);
  return 1;
}
bool scan(char &s) {
  register char ch = getchar();
  register bool b = 0;
  if (ch == EOF) return 0;
  while (ch == ' ' || ch == 10 || ch == 11 || ch == 14) {
    ch = getchar();
  }
  if (ch == EOF) return 0;
  s = ch;
  return 1;
}
bool scan(char s[]) {
  register char ch = getchar();
  register bool b = 0;
  if (ch == EOF) return 0;
  while (ch == ' ' || ch == 10 || ch == 11 || ch == 14) {
    ch = getchar();
  }
  if (ch == EOF) return 0;
  char *t = s;
  while (ch != ' ' && ch != 10 && ch != 11 && ch != 14 && ch != EOF) {
    *t = ch;
    t++;
    ch = getchar();
  }
  return 1;
}
bool scan(double &x) {
  register char ch = getchar();
  register bool b = 0;
  if (ch == EOF) return 0;
  while (ch == ' ' || ch == 10 || ch == 11 || ch == 14) {
    ch = getchar();
  }
  if (ch == EOF) return 0;
  if (ch < '0' && ch > '9' && ch != '-') return 0;
  if (ch == '-') {
    b = 1;
    ch = getchar();
    if (ch == EOF) return 0;
  }
  if (ch < '0' || ch > '9') return 0;
  x = 0.0;
  register bool f = 0;
  register int h = 10;
  while ((ch >= '0' && ch <= '9') || (ch == '.' && !f)) {
    if (ch == '.') {
      f = 1;
      ch = getchar();
      if (ch == EOF) return 0;
    }
    if (f) {
      x += double(ch - '0') / h;
      h *= 10;
    } else
      x = x * 10 + (ch - '0');
    ch = getchar();
  }
  x *= (b ? -1 : 1);
  return 1;
}
template <typename X>
void getarr(X *a, int n) {
  for (int i = 0; i < n; i++) scan(a[i]);
}
void getarr(string *a, int n) {
  for (int i = 0; i < n; i++) cin >> a[i];
}
template <typename X>
void putarr(X *a, int n, char ch = ' ') {
  for (int i = 0; i < n; i++) cout << a[i] << ch;
}
inline bool XOR(bool p, bool q) { return ((p || q) && !(p && q)); }
template <typename X>
inline X abs(X a) {
  return a < 0 ? -1 * a : a;
}
template <typename T>
inline auto sqr(T a) -> decltype(a * a) {
  return a * a;
}
template <typename T>
inline auto cub(T a) -> decltype(a * a * a) {
  return a * a * a;
}
inline void swap(int &a, int &b) {
  a ^= b;
  b ^= a;
  a ^= b;
}
inline void swap(unsigned &a, unsigned &b) {
  a ^= b;
  b ^= a;
  a ^= b;
}
inline void swap(long long &a, long long &b) {
  a ^= b;
  b ^= a;
  a ^= b;
}
inline void swap(unsigned long long &a, unsigned long long &b) {
  a ^= b;
  b ^= a;
  a ^= b;
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename X>
int binf(X *a, int l, int r, X p) {
  while (l < r) {
    int m = (l + r) >> 1;
    if (p > a[m])
      l = m + 1;
    else
      r = m;
  }
  if (a[l] == p)
    return l;
  else
    return -1;
}
template <typename X>
X gcd(X a, X b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <typename X>
X gcd(X a, X b, X &x, X &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  X x1, y1;
  X d = gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
template <typename X>
X binpow(X a, int n, int m = 0) {
  X res = 1;
  if (m) res %= m;
  while (n) {
    if (n & 1) {
      res *= a;
      if (m) res %= m;
    }
    a *= a;
    if (m) a %= m;
    n >>= 1;
  }
  return res;
}
pair<int, int> x[100009];
int ans[100009];
int main() {
  int n;
  scan(n);
  for (int i = 0; i < n; i++) {
    scan(x[i].first);
    scan(x[i].second);
  }
  sort(x, x + n);
  ans[0] = 0;
  int a = n;
  for (int i = 0; i < n; i++) {
    int l = x[i].first - x[i].second;
    int p = lower_bound(x, x + i, make_pair(l, -1)) - x;
    ans[i] = i - p;
    if (p > 0) ans[i] += ans[p - 1];
    a = min(a, ans[i] + n - i - 1);
  }
  cout << a;
  return 0;
}
