main idea :
==========程式分隔線==========
def gd(a) : # get direction
if a == 0 : return 0
else : return a // abs(a)
def main() :
ans = [0, 0, 0] # left, right, back
dirs = [[1, 0], [0, -1], [-1, 0], [0, 1]]
cur = [0, 0, 0] # x, y ,dir
n = int(input())
for _ in range(n) :
cur_point = [int(x) for x in input().split(' ')]
cur_dir = [gd(cur_point[0] - cur[0]) , gd(cur_point[1] - cur[1])]
if cur_dir not in dirs :
print(cur[:2] , cur_point , 'something go wrong')
else :
cur_dir_index = dirs.index(cur_dir)
if cur_dir_index == (cur[2] - 1) % 4 :
ans[0] += 1
elif cur_dir_index == (cur[2] + 1) % 4 :
ans[1] += 1
elif cur_dir_index == (cur[2] + 2) % 4 :
ans[2] += 1
cur = cur_point + [cur_dir_index]
print(ans[0], ans[1], ans[2])
if __name__ == '__main__' :
main()