#include<bits/stdc++.h>
using namespace std;
signed main() {
ios_base::sync_with_stdio(0);cin.tie(0);
int way=78;
int n;
cin>>n;
int x=0;
int y=0;
int L=0,R=0,T=0;
while(n--) {
int xx;
int yy;
int inway;
cin>>xx>>yy;
if(x==xx&&yy>y) inway=0;
if(x==xx&&yy<y) inway=2;
if(xx>x&&yy==y) inway=3;
if(xx<x&&yy==y) inway=1;
if(inway==0&&way==2) T++;
else if(inway==1&&way==3) T++;
else if(inway==2&&way==0) T++;
else if(inway==3&&way==1) T++;
else if(inway==0&&way==1) L++;
else if(inway==1&&way==2) L++;
else if(inway==2&&way==3) L++;
else if(inway==3&&way==0) L++;
else if(inway==0&&way==3) R++;
else if(inway==3&&way==2) R++;
else if(inway==2&&way==1) R++;
else if(inway==1&&way==0) R++;
x=xx;
y=yy;
way=inway;
}
cout<<R<<" "<<L<<" "<<T;
}