n=int(input())
L=[[int(x) for x in input().split()]for _ in range(n)]
dl=[0,0,0]
a,b,c=0,0,0 #左右回
for i in L:
if i[0]==dl[0]:
if i[1]>dl[1]: #y+
if dl[2]==0:
a+=1
elif dl[2]==1:
c+=1
elif dl[2]==2:
b+=1
else:
None
dl[2]=3
else: #y-
if dl[2]==0:
b+=1
elif dl[2]==1:
None
elif dl[2]==2:
a+=1
else:
c+=1
dl[2]=1
else: #x+
if i[0]>dl[0]:
if dl[2]==0:
None
elif dl[2]==1:
a+=1
elif dl[2]==2:
c+=1
else:
b+=1
dl[2]=0
else: #x-
if dl[2]==0:
c+=1
elif dl[2]==1:
b+=1
elif dl[2]==2:
None
else:
a+=1
dl[2]=2
dl[0],dl[1]=i[0],i[1]
print(a,b,c)