#include<unordered_map>
#include<iostream>
#include<cstdlib>
#include<vector>
#include<set>
using namespace std;
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
signed main(void){
int x = 0, y = 0, flag = 0, U = 0, left = 0, right = 0, n; cin >> n;
for(int i = 0; i < n; i++){ // right: 0, left: 1, up: 2, down: 3
int x2, y2; cin >> x2 >> y2;
int x_dif = x2 - x, y_dif = y2 - y;
int sig = 0;
if(x_dif > 0) sig = 0;
else if(x_dif < 0) sig = 1;
else if(y_dif > 0) sig = 2;
else sig = 3;
if(flag == 0){
if(sig == 1) U++;
if(sig == 2) left++;
if(sig == 3) right++;
}
else if(flag == 1){
if(sig == 0) U++;
if(sig == 3) left++;
if(sig == 2) right++;
}
else if(flag == 2){
if(sig == 3) U++;
if(sig == 1) left++;
if(sig == 0) right++;
}
else{
if(sig == 2) U++;
if(sig == 0) left++;
if(sig == 1) right++;
}
flag = sig;
x = x2;
y = y2;
}
cout << left << " " << right << " " << U << "\n";
}