import sys

def solve():
    num_rect, num_rhom = 0, 0
    for line in sys.stdin:
        a, b, c = map(int, line.split(','))
        if c ** 2 == a ** 2 + b ** 2:
            num_rect += 1
        elif a == b:
            num_rhom += 1
    
    print(num_rect)
    print(num_rhom)

if __name__ == "__main__":
    solve()

