#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > S;
pair<int, int> p[100005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &p[i].first, &p[i].second);
  int ans = 0;
  sort(p + 1, p + n + 1);
  S.insert(make_pair(-1, 0));
  for (int i = 1; i <= n; i++) {
    pair<int, int> T =
        *--S.lower_bound(make_pair(p[i].first - p[i].second, -5));
    ans = max(ans, T.second + 1);
    S.insert(make_pair(p[i].first, T.second + 1));
  }
  cout << n - ans << endl;
}
