/* Author haleyk10198 */
#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <ctime>
#include <string>
#include <set>
#define E9 1000000000
#define INF 2147483647
#define PI 3.14159
#define ll long long
#define pii pair<int,int>
using namespace std;
vector<pii> arr;
int bins(int left,int right,int val){
//classic binary search to find the last undestroyed beacon
int mid=(left+right)>>1;
if(arr[mid].first<val&&arr[mid+1].first>=val)
return mid;
else if(arr[mid].first>=val)
return bins(left,mid-1,val);
else
return bins(mid+1,right,val);
}
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
int a,b;
scanf("%d%d",&a,&b);
arr.push_back(pii(a,b));
}
sort(arr.begin(),arr.end());
int dp[n][2]; //state 0:off state1: on
for(int i=0;i<n;i++){
dp[i][0]=0;
dp[i][1]=1;
}
for(int i=1;i<n;i++){
dp[i][0]=max(dp[i-1][0],dp[i-1][1]);
//if the beacon is not activated then take the max number of prev. positions
if(arr[i].first-arr[i].second>arr[0].first){
int prev=bins(0,n-1,arr[i].first-arr[i].second);
dp[i][1]=dp[prev+1][0]+1;
//if it is to be activated then add it by finding the last undestroyed beacon
}
}
printf("%d\n",n-max(dp[n-1][0],dp[n-1][1]));
return 0;
}
LyogQXV0aG9yIGhhbGV5azEwMTk4ICovCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGZzdHJlYW0+CiNpbmNsdWRlIDxzc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGxpYj4KI2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPHF1ZXVlPgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxhbGdvcml0aG0+CiNpbmNsdWRlIDxjc3RyaW5nPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPGN0aW1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