import sys


def main():
    rect = 0
    lozen = 0

    for line in sys.stdin:
        data = line.strip().split(',')
        data = map(int, data)
        a = data[0]
        b = data[1]
        c = data[2]

        if is_rect_angle(a, b, c):
            rect += 1

        if is_lozenges(a, b, c):
            lozen += 1

    print rect
    print lozen


def is_rect_angle(a, b, c):
    return a**2 + b**2 == c**2


def is_lozenges(a, b, c):
    return a == b

main()