#include <algorithm>
#include <iostream>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
    int n;
    cin >>n;

    pair<int,int> *points = new pair<int,int>[2*n];

    for (int i=0; i<n; i++) {
        int x,r;
        cin >>x>>r;
        points[2*i] = make_pair(x-r, -i-1);
        points[2*i+1] = make_pair(x+r, i+1);
    }

    sort(points, points+2*n);
    int count = 0;
    int prev = 0;
    int nest = 0;
    for (int i=0; i<2*n; i++) {
        auto p = points[i];
        if (p.second == -prev && nest == 1) count++;
        if (p.second<0) nest++;
        if (p.second>0) nest--;
        prev = p.second;
    }

    cout <<count<<"\n";
    delete [] points;
}