import sys


def isRectangle(s1, s2, d):
    if s1*s1 + s2*s2 == d*d:
        return True
    else:
        return False

def isLozenge(s1, s2):
    if s1 == s2:
        return True
    else:
        return False

rcnt = 0
lcnt = 0
L = sys.stdin.readlines()
for dataset in L:
    side1, side2, diagonal = map(int, dataset.split(','))
    if isRectangle(side1, side2, diagonal):
        rcnt += 1
    if isLozenge(side1, side2):
        lcnt += 1
print(rcnt)
print(lcnt)