#include <iostream>
#include <cmath>
using namespace std;

double distanca(double x, double y, double a, double b);
int main()
{
   int sum=0,n;
   cin>> n;
   double x[n],y[n];
   double dis[n];
   for (int i=0;i<n;i++){
    cin>> x[i]>>y[i];

   }
    for (int i=0;i<n;i++){
        dis[i]=distanca(x[i],y[i],x[i+1],y[i+1]);

    }
    for (int i=0;i<n;i++){
        if (dis[i]==dis[i+1]*2||dis[i]*2==dis[i+1]){
            sum++;
        }
        else if (dis[i]==dis[i+2]*2||dis[i]*2==dis[i+2]){
           sum++;
        }
        else if (dis[i]==dis[i+3]*2||dis[i]*2==dis[i+3]){
           sum++;
        }
    }

    cout << sum;
    return 0;
}

double distanca(double x, double y, double a, double b){
return sqrt(pow(x - a, 2) + pow(y - b, 2));
}