import sys
rectangle=0
rhombus=0
for length in sys.stdin:
    e1,e2,diag=map(int,length.split(","))
    if (e1**2+e2**2 == diag**2):
        rectangle+=1
    if (e1==e2 and e1+e2>diag):
        rhombus+=1

print rectangle
print rhombus