#include <bits/stdc++.h>
using namespace std;
namespace io {
char ibuf[(1 << 18)], *iS, *iT, obuf[(1 << 18)],
    *oS = obuf, *oT = oS + (1 << 18) - 1, c, qu[55];
int f, qr;
inline void flush(void) {
  fwrite(obuf, 1, oS - obuf, stdout);
  oS = obuf;
  return;
}
inline char getch(void) {
  return (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, (1 << 18), stdin),
                      (iS == iT ? EOF : *iS++))
                   : *iS++);
}
inline void putch(char x) {
  *oS++ = x;
  if (oS == oT) flush();
  return;
}
void putstr(string str, int begin = 0, int end = -1) {
  if (end == -1) end = str.size();
  for (register int i = begin; i < end; i++) putch(str[i]);
  return;
}
template <typename T>
inline T read() {
  register T x = 0;
  for (f = 1, c = getch(); c < '0' || c > '9'; c = getch())
    if (c == '-') f = -1;
  for (x = 0; c <= '9' && c >= '0'; c = getch()) x = x * 10 + (c & 15);
  x *= f;
  return x;
}
template <typename T>
inline void write(const T& t) {
  register T x = t;
  if (!x) putch('0');
  if (x < 0) putch('-'), x = -x;
  while (x) qu[++qr] = x % 10 + '0', x /= 10;
  while (qr) putch(qu[qr--]);
  return;
}
struct Flusher_ {
  ~Flusher_() { flush(); }
} io_flusher_;
}  // namespace io
using io::getch;
using io::putch;
using io::putstr;
using io::read;
using io::write;
pair<int, int> a[100005];
int f[100005];
int main() {
  int n = read<int>();
  for (register int i = 1; i <= n; i++)
    a[i].first = read<int>(), a[i].second = read<int>();
  sort(a + 1, a + n + 1);
  int answer = f[1] = 1;
  for (register int i = 2; i <= n; i++) {
    f[i] = 1 + f[lower_bound(a + 1, a + i,
                             (pair<int, int>){a[i].first - a[i].second, 0}) -
                 a - 1];
    answer = max(answer, f[i]);
  }
  write(n - answer), putch('\n');
  return 0;
}
