Title: Plastic Sheets

In a factory, data on the lengths of sides and diagonals are input into a machine for cutting plastic sheets into parallelogram shapes. The factory produces various sizes, but only cuts parallelograms. You are tasked with counting the number of rectangles and rhombuses among the cut parallelograms.

Create a program that reads the input data and outputs the number of rectangles and rhombuses.

Input:
The input is given in the following format:
a1, b1, c1
a2, b2, c2
...

The input data for the machine is given on multiple lines. The i-th line contains integers a_i, b_i representing the lengths of adjacent sides of the i-th parallelogram, and c_i representing the length of the diagonal, separated by commas (1 ≤ ai, bi, ci ≤ 1000, ai + bi > ci). The number of data entries does not exceed 100.

Output:
Output the number of rectangles and rhombuses on separate lines.

Sample Input:
3,4,5
5,5,8
4,4,4
5,4,3

Output for the Sample Input:
1
2

# Buggy version:
s=0
n=0
while True:
    try:
        a,b,c = map(int, input().split())
    except:
        break

    if a == b:
        n+=1
    elif c**2 == a**2 + b**2:
        s+=1

    print(str(s) + "\n" + str(n))

# Fixed version:
s=0
n=0
while True:
    try:
        a,b,c = map(int, input().split(","))
    except:
        break
 
    if a == b:
        n+=1
    elif c**2 == a**2 + b**2:
        s+=1
 
print(str(s) + "\n" + str(n))

# Buggy version:
import sys

t = 0
h = 0
for line in sys.stdin :
    line = list(map(int, line.split(',')))
    if line[2]**2 == line[0] ** 2 + line[1] ** 2 :
        t += 1
    else :
        h += 1
print(t)
print(h)

# Fixed version:
import sys

t = 0
h = 0
for line in sys.stdin :
    line = list(map(int, line.split(',')))
    if line[2]**2 == line[0] ** 2 + line[1] ** 2 :
        t += 1
    elif line[0] == line[1] :
        h += 1
print(t)
print(h)

# Buggy version:
hisi=0
tyou=0
while True:
    try:
        a,b,c=map(int,input().split(","))
        if a**2+b**2==c**2:
            tyou +=1
        elif a==b:
            hisi +=1
    except:
        print(tyou)
        print(hisi)


# Fixed version:
hisi = 0
tyou = 0
while True:
    try:
        a,b,c = map(int,input().split(","))
        if a == b:
            hisi += 1
        elif a ** 2 + b ** 2 == c ** 2:
            tyou += 1
    except EOFError:
        print(tyou)
        print(hisi)
        break

# Buggy version:
import sys

rhombus = rectangle = 0
for line in sys.stdin:
    a, b, c = map(int, line.split(","))
    if c ** 2 == a ** 2 + b ** 2:
        rectangle += 1
    if a == b and c ** 2 != a ** 2 + b ** 2:
        rhombus += 1
print(rectangle, rhombus)

# Fixed version:
import sys

rhombus = rectangle = 0
for line in sys.stdin:
    a, b, c = map(int, line.split(","))
    if c ** 2 == a ** 2 + b ** 2:
        rectangle += 1
    elif a == b:
        rhombus += 1
print(rectangle)
print(rhombus)

# Buggy version:
import sys

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

# Fixed version:
import sys

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

# Buggy version:
while True:
  try:
    a, b, c = map(int, input().split(","))
    
    rect_cnt += (a ** 2 + b ** 2 ==  c ** 2)
    dia_cnt += (a == b)

  except EOFError:
    break

print(rect_cnt)
print(dia_cnt)


# Fixed version:
rect_cnt = dia_cnt = 0
 
while True:
  try:
    a, b, c = map(int, input().split(","))
     
    rect_cnt += (a ** 2 + b ** 2 ==  c ** 2)
    dia_cnt += (a == b)
 
  except EOFError:
    break
print(rect_cnt)
print(dia_cnt)