rectangles, lozenges = 0, 0
while 1:
    try:
        a, b, c = map(int, input().split(','))
        if a ** 2 + b ** 2 == c ** 2:
            rectangles += 1
            if a == b:
                lozenges += 1
        elif a == b:
            lozenges += 1
    except:
        break

print(rectangles)
print(lozenges)

