#include <bits/stdc++.h>
using namespace std;
using ll = long long;
//#define int ll
using P = pair<int, int>;
#define all(x) x.begin(), x.end()
#define rep(x,s,e) for (auto x=(s)-((s)>(e));x!=(e)-((s)>(e));((s)<(e)?x++:x--))
#define sz(x) (int)x.size()
const char nl = '\n';
const int mod = 998244353;
const int NMAX = 1e3+10;
int a[NMAX], vis[NMAX];
vector<int> g[NMAX];
stack<int> st;
void fnd(int nd = 1) {
vis[nd] =1;
for (auto i: g[nd])
if (!vis[i])fnd(i);
st.push(nd);
}
int find(int x) {
if (a[x] == x)return x;
return a[x] = find(a[x]);
}
int unite(int x, int y) {
x = find(x), y = find(y);
if (x == y)return 0;
a[x] = y; return 1;
}
void dfs(int nd) {
vis[nd] = 1;
for (auto i: g[nd])
if (!vis[i])dfs(i);
}
void solve() {
int n; cin >> n;
rep(i, 1, n+1)a[i] = i;
set<P> s;
//vector<int> ;
rep(i, 1, n+1) {
int x, y; cin >> x >> y;
s.insert(P(x, y));
//cin >> x[i] >> e[i];
}
n = sz(s);
vector<int> x(n+1), e(n+1);
auto it = s.begin();
rep(i, 1, n+1) {
x[i] = it->first,
e[i] = it->second;
it++;
}
int res = 0;
rep(i, 1, n+1)
rep(j, 1, n+1)
if (i != j && abs(x[i]-x[j]) <= e[i]-e[j]) {
//res -= unite(i, j);
g[i].push_back(j);
//cout << j << " " << i << nl;
//cout << i << " " << j << nl;
}
rep(i, 1, n+1)
if (!vis[i])fnd(i);
memset(vis, 0, sizeof vis);
while (!st.empty()) {
int z = st.top(); st.pop();
//cout << z << " ";
if (!vis[z])dfs(z), res += 1;
}
//cout << nl;
cout << res << nl;
}
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
solve();
return 0;
}