import sys


# ???????????????????§???¢?????§???
# https://ja.wikipedia.org/wiki/????§???¢
def is_rectangle(a, b, c):
    """ ????????¢?????§???
        4??????????§??????¨???90???
    """
    return a**2 + b**2 == c**2


def is_rhombus(a, b, c):
    """ ????????¢?????§???
        ??¨???????????????????????????????????????
    """
    return a==b


if __name__ == '__main__':
    rectangle_count = 0  # ???????????§???????????¢?????°
    rhombus_count = 0  # ???????????§???????????¢?????°

    # ??????????????\???
    for line in sys.stdin:
        a, b, c = [int(x) for x in line.strip().split(',')]

        # ????????¢???????????¢???????????????
        if is_rectangle(a, b, c):
            rectangle_count += 1
        if is_rhombus(a, b, c):
            rhombus_count += 1
    
    # ????????????????????????
    print('{0}\n{1}'.format(rectangle_count, rhombus_count))