import sys
rect = 0
dia = 0

for s in sys.stdin:
	side1, side2, diag = map(int, s.split(','))
	rect += 1 if diag**2 == side1**2 + side2**2 else 0
	dia += 1 if side1 == side2 else 0

print(rect)
print(dia)