def main():
    Rec = 0
    Dia = 0
    while True:
        try:
            a,b,c = map(int,input().split(","))
            if a == b:
                Dia += 1
            elif a != b and c > a and c > b:
                Rec += 1
        except EOFError:
            break
    print(Rec)
    print(Dia)

if __name__ == '__main__':
    main()
