#include <iostream>

using namespace std;

int main()
{
    int N,x[100],y[100],br=0,zbir=0;
    cin>>N;
    for(int i=0;i<N;i++)
    {
        cin>>x[i]>>y[i];

    }
    for(int i=0;i<N;i++)
    {
        if(x[i]+y[i]>(x[i+1]+y[i+1])*2)
            br++;
        else
            br=br;
    }
    cout<<br;
    return 0;
}