Problem:


プラスティック板

機械に辺・対角線の長さのデータを入力し、プラスティック板の型抜きをしている工場があります。この工場では、サイズは様々ですが、平行四辺形の型のみを切り出しています。あなたは、切り出される平行四辺形のうち、長方形とひし形の製造個数を数えるように上司から命じられました。

「機械に入力するデータ」を読み込んで、長方形とひし形の製造個数を出力するプログラムを作成してください。

Input

入力は以下の形式で与えられます。

a1,b1,c1
a2,b2,c2
:

機械に入力するデータが複数行に与えられます。i 行目に i 番目の平行四辺形の隣り合う２辺の長さを表す整数 ai, bi と対角線の長さを表す整数 ci がカンマ区切りで与えられます (1 ≤ ai, bi, ci ≤ 1000, ai + bi > ci)。データの数は 100 件を超えません。

Output

１行目に長方形の製造個数、２行目ひし形の製造個数を出力します。

Sample Input

3,4,5
5,5,8
4,4,4
5,4,3

Output for the Sample Input

1
2



Sample input:
3,4,5
5,5,8
4,4,4
5,4,3


Sample output:
1
2

Submission status: Wrong Answer

Solution code:
import sys

rect = 0
dia = 0
for line in sys.stdin:
    a,b,c = [int(i) for i in line.split(",")]
    if a**2 + b**2 == c**2:
        rect += 1
    elif a == b or b == c or c == a:
        dia += 1

print(rect)
print(dia)

Submission status: Wrong Answer

Solution code:
import sys

rect = 0
dia = 0
for line in sys.stdin:
    a,b,c = [int(i) for i in line.split(",")]
    if a**2 + b**2 == c**2:
        rect += 1
    if a == b or b == c or c == a:
        dia += 1

print(rect)
print(dia)

Submission status: Wrong Answer

Solution code:
def rect((a,b,c)):
    #a,b,c = sorted([a,b,c])
    if a**2 + b**2 == c**2:
        return True
    else:
        return False
def diam((a,b,c)):
    if a == b or b == c or c == a:
        return True
    else:
        return False

ls = []
while True:
    try:
        a,b,c = map(int,raw_input().split(','))
        ls.append((a,b,c))
    except:
        break
        
rec = 0; dia = 0
for k in range(len(ls)):
    if rect(ls[k]):
        rec +=1
    if diam(ls[k]):
        dia +=1
print rec
print dia

Submission status: Wrong Answer

Solution code:
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))

Submission status: Wrong Answer

Solution code:
from math import *
PI = 3.1415926535898
res = []
while True:
	try:
		arr = map(int, raw_input().strip().split(','))
		res.append(arr)
	except EOFError:
		break
ans1 = 0
ans2 = 0
for x in res:
	if x[0]*x[0] + x[1]*x[1] == x[2]*x[2] or x[1]*x[1] + x[1]*x[1] == x[0]*x[0] or x[0]*x[0] + x[2]*x[2] == x[1]*x[1]:
		ans1 += 1
	if x[0]==x[1] or x[0]==x[2] or x[1]==x[2]:
		ans2 += 1
print ans1
print ans2

Submission status: Wrong Answer

Solution code:
#encoding=utf-8

import sys
num = []
cyou, hisi = 0, 0
for i in sys.stdin:
	num = map(int, i.split(","))
	num.sort()
	if num[0]**2 + num[1]**2 == num[2]**2:
		cyou += 1
	elif num[0] == num[1] != num[2]:
		hisi += 1
	
print cyou
print hisi

Submission status: Wrong Answer

Solution code:

import sys
num = []
cyou, hisi = 0, 0
for i in sys.stdin:
	num = map(int, i.split(","))
	if num[0]**2 + num[1]**2 == num[2]**2:
		cyou += 1
	elif num[0] != num[2] or num[1] != num[2] :
		hisi += 1
	
print cyou
print hisi

Submission status: Wrong Answer

Solution code:
r, l = 0, 0
while 1:
    try:
        a, b, c = map(int, raw_input().split(','))
        if (a ** 2) + (b ** 2) == c ** 2: r += 1
        elif len(set([a, b, c])) < 3: l += 1

    except:
        break
print "%d %d" % (r, l)

Submission status: Wrong Answer

Solution code:
r, l = 0, 0
while 1:
    try:
        a, b, c = map(int, raw_input().split(','))
        if a == b:
            if (a ** 2) + (b ** 2) != c **2: l += 1
        elif (a ** 2) + (b ** 2) == c **2: r += 1
    except:
        break
print "%d %d" % (r, l)

Submission status: Wrong Answer

Solution code:
r, l = 0, 0
while 1:
    try:
        a, b, c = map(int, raw_input().split(','))
        if a == b: l += 1
        elif (a ** 2) + (b ** 2) == c **2: r += 1
    except:
        break
print "%d %d" % (r, l)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
import sys
j = []
for line in sys.stdin:
    a, b, c = line.split(",")
    j += [int(a)**2 + int(b)**2 - int(c)**2]
print(len([i for i in j if not i]))
print(len([i for i in j if i]))

Submission status: Wrong Answer

Solution code:
import sys
j = []
for line in sys.stdin:
    try:
        a, b, c = line.split(",")
        if int(a) ** 2 + int(b) ** 2 - int(c) ** 2 >= 0:
            j += [int(a)**2 + int(b)**2 - int(c)**2]
    except:
        break
print(len([i for i in j if not i]))
print(len([i for i in j if i]))

Submission status: Wrong Answer

Solution code:
ans=[] ; naga,hisi = 0,0
while True:
  try:
    a = map(int,raw_input().split(","))
    a.sort()
    if a in ans:
      continue
    elif a not in ans:
      ans.append(a)
      if a[0]**2+a[1]**2 == a[2]**2:
        naga+=1
      elif a[0]==a[1] or a[1]==a[2]:
        hisi+=1
  except EOFError: 
    print "%d\n%d"%(naga,hisi)
    break

Submission status: Wrong Answer

Solution code:
import sys
rect = 0
hisi = 0
for line in sys.stdin.readlines():
    x,y,z = map(int,line.split(','))
    if x**2 + y**2 == z**2:rect += 1
    elif x == y : hisi +=1

print rect,hisi

Submission status: Wrong Answer

Solution code:
import sys
s=[0]*2
for line in sys.stdin.readlines():
    x,y,z=map(int,line.rstrip().split(","))
    if (x%3|y%4|z%5)==0:
        s[0]+=1
    elif x==y:
        s[1]+=1

print "\n".join(map(str,s))

Submission status: Wrong Answer

Solution code:
rectangles = 0 ; lozenges = 0
while True:
	try:
		a,b,c, = map(int,raw_input().split(','))
		if a*a + b*b == c*c: rectangle += 1
		else:
			if a == b: lozenges += 1
	except: break
print rectangles ; print lozenges

Submission status: Wrong Answer

Solution code:
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)

Submission status: Time Limit Exceeded

Solution code:
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)

Submission status: Accepted

Solution code:
import sys

rect = 0
dia = 0
for line in sys.stdin:
    a,b,c = [int(i) for i in line.split(",")]
    if a**2 + b**2 == c**2:
        rect += 1
    if a == b:
        dia += 1

print(rect)
print(dia)

Submission status: Accepted

Solution code:
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)
        break

Submission status: Accepted

Solution code:
rect = 0
loze = 0

while True:
    try:
        n, m, o = map(int, input().split(','))
        if n ** 2 + m ** 2 == o ** 2:
            rect += 1
        if n == m:
            loze += 1
    except:
        print(rect)
        print(loze)
        break

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


count1 = count2 = 0
for s in sys.stdin:
  d = map(int,s.split(","))
  if d[2]**2 == d[0]**2 + d[1]**2:
    count1 += 1
  if d[0] == d[1]:
    count2 +=1

print count1
print count2

Submission status: Accepted

Solution code:
import sys
f = sys.stdin

rhombus = oblong = 0
for line in f:
    a, b, c = map(int, line.split(','))
    if a == b:
        rhombus += 1
    if a * a + b * b == c * c:
        oblong += 1

print(oblong)
print(rhombus)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
import sys
rectangle=0
rhombus=0
for length in sys.stdin:
    e1,e2,diag=map(int,length.split(","))
    if (e1**2+e2**2 == diag**2):
        rectangle+=1
    if (e1==e2 and e1+e2>diag):
        rhombus+=1

print rectangle
print rhombus

Submission status: Accepted

Solution code:
rectangles = 0
lozenges = 0
while True:
    try:
        x, y, r = map(int, raw_input().split(','))
        if x == y:
            lozenges += 1
        elif x**2 + y**2 == r**2:
            rectangles += 1
    except EOFError:
        print rectangles
        print lozenges
        break

Submission status: Accepted

Solution code:
import sys
rect = 0
dia = 0

for s in sys.stdin:
	side1, side2, diag = map(int, s.split(','))
	rect += 1 if diag**2 == side1**2 + side2**2 else 0
	dia += 1 if side1 == side2 else 0

print(rect)
print(dia)

Submission status: Accepted

Solution code:
t=h=0
while 1:
    try:
        a,b,c=map(int,raw_input().split(","))
        if a==b:
            h+=1
        elif c**2==a**2+b**2:
            t+=1
    except:
        break
print t
print h

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import *
PI = 3.1415926535898
res = []
while True:
	try:
		arr = map(int, raw_input().strip().split(','))
		res.append(arr)
	except EOFError:
		break
ans1 = 0
ans2 = 0
for x in res:
	if x[0]*x[0] + x[1]*x[1] == x[2]*x[2]:
		ans1 += 1
	elif x[0]==x[1]:
		ans2 += 1
print ans1
print ans2

Submission status: Accepted

Solution code:

import sys,math
countrect = 0
countloze = 0
for line in sys.stdin.readlines():
   x , y , d1 = map(int,line.split(','))
   if x == y:
       d2 = 4*x*x - d1*d1
       if d1*d1 + d2 == 4*x*x:
           countloze += 1
   else:
       if x*x + y*y == d1*d1:
           countrect += 1
print(countrect)
print(countloze)

Submission status: Accepted

Solution code:
import sys
cyou, hisi = 0, 0
for i in sys.stdin:
	x,y,z = map(int, i.split(","))
	if x**2+y**2 == z**2:
		cyou += 1
	elif x == y:
		hisi += 1
print cyou
print hisi

Submission status: Accepted

Solution code:
rec, loz = 0, 0
while True:
    try:
        a, b, c = map(int, input().split(','))
    except:
        break
    if a == b:
        loz += 1
    elif a ** 2 + b ** 2 == c ** 2:
        rec += 1
print(rec)
print(loz)

Submission status: Accepted

Solution code:
import sys


def isRectangle(s1, s2, d):
    if s1*s1 + s2*s2 == d*d:
        return True
    else:
        return False

def isLozenge(s1, s2):
    if s1 == s2:
        return True
    else:
        return False

rcnt = 0
lcnt = 0
L = sys.stdin.readlines()
for dataset in L:
    side1, side2, diagonal = map(int, dataset.split(','))
    if isRectangle(side1, side2, diagonal):
        rcnt += 1
    if isLozenge(side1, side2):
        lcnt += 1
print(rcnt)
print(lcnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

def isRec(a, b, c):
    if a*a + b*b == c*c:
        return True
    return False

def isLoz(a, b, c):
    if a == b:
        return True
    return False

count_Rec = 0
count_Loz = 0
for line in sys.stdin:
    a, b, c = map(int, line.split(','))
    if isRec(a, b, c):
        count_Rec += 1
    if isLoz(a, b, c):
        count_Loz += 1
print count_Rec
print count_Loz

Submission status: Accepted

Solution code:
import sys

tyou = 0
hishi = 0

for line in sys.stdin:
    L = map(int, line.split(","))
    
    if L:
        if (L[2] ** 2 == L[0] ** 2 + L[1] ** 2):
            tyou += 1

        if (L[0] == L[1]):
            hishi += 1
    else:
        break

print tyou
print hishi

Submission status: Accepted

Solution code:
import sys
rect = 0
loze = 0
for line in sys.stdin:
    s = line.split(',')
    a,b,c = int(s[0]),int(s[1]),int(s[2])
    if a**2 + b**2 == c**2:
        rect += 1
    if a == b and a+b > c:
        loze += 1
print(rect)
print(loze)

Submission status: Accepted

Solution code:
r1 = r2 = 0
try:
    while 1:
        a, b, c = map(int, input().split(','))
        if a ** 2 + b ** 2 == c ** 2:
            r1 += 1
        elif a == b:
            r2 += 1
except:
    pass

print(r1)
print(r2)

Submission status: Accepted

Solution code:
r = 0
l = 0
while True:
    try:
        a, b, c = map(int, input().split(','))
        if a == b:
            l += 1
        else:
            if a**2 + b**2 == c**2:
                r += 1
    except:
        print(r)
        print(l)
        break

Submission status: Accepted

Solution code:
rec = rho = 0
while True:
    try:
        a, b, c = map(int, input().split(','))
    except:
        break
    if a ** 2 + b ** 2 == c ** 2:
        rec += 1
    if a == b:
        rho += 1
print(rec, rho, sep='\n')

Submission status: Accepted

Solution code:
r, l = 0, 0
while 1:
    try:
        a, b, c = map(int, raw_input().split(','))
        if a == b: l += 1
        elif (a ** 2) + (b ** 2) == c **2: r += 1
    except:
        break
print "%d\n%d" % (r, l)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
ans1=0
ans2=0
while 1:
    try:
        a,b,c=map(int,raw_input().split(","))
        if a**2+b**2==c**2:
            ans1+=1
        elif a==b:
            ans2+=1
    except:
        break
print ans1
print ans2

Submission status: Accepted

Solution code:
import sys
rec=rho=0
for line in sys.stdin:
	a,b,c=map(int,line.split(","))
	if a==b:
		rho+=1
	elif a*a+b*b==c*c:
		rec+=1
print rec
print rho

Submission status: Accepted

Solution code:
import sys

ch, hi = 0, 0
for line in sys.stdin:
    a, b, c = map(int, line.rstrip().split(','))
    if a == b:
        hi += 1
    if a*a + b*b == c*c:
        ch += 1
print ch
print hi

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
import sys
rect, loze = 0, 0
for line in sys.stdin:
    a, b, c = map(int, (line.strip().split(',')))
    if a**2 + b**2 == c**2:
        rect += 1
    if a == b:
        loze += 1
print(rect)
print(loze)

Submission status: Accepted

Solution code:
d,e=0,0
while 1:
    try:
        a,b,c=map(int,input().split(','))
        if a**2+b**2==c**2:d+=1
        elif a==b:e+=1
    except:
        print('{}\n{}'.format(d,e))
        break

Submission status: Accepted

Solution code:
rh = 0
rect = 0
while True:
    try:
        a,b,c = map(int,input().split(','))
        if a == b:
            rh += 1
        elif a**2 + b**2 == c**2:
            rect += 1
    except EOFError:
        break
print(rect)
print(rh)

Submission status: Accepted

Solution code:
import sys

lec=0
loz=0
while True:
  line = sys.stdin.readline()
  if not line: break
  l = line.rstrip().split(",")
  a = int(l[0])
  b = int(l[1])
  c = int(l[2])
  if a*a+b*b == c*c:
    lec += 1
  elif a == b:
    loz += 1

print lec
print loz

Submission status: Accepted

Solution code:
n_rect = 0
n_dia = 0
while True:
    try:
        a,b,c = map(int, input().split(','))
        if a**2 + b**2 == c**2:
            n_rect += 1
        if a == b:
            n_dia += 1
    except EOFError:
        break

print(n_rect) 
print(n_dia)

Submission status: Accepted

Solution code:
rec = 0
loz = 0

while True:
    try:
        a,b,c = map(int,input().split(','))
    except EOFError:
        break
    if a == b:
        loz += 1
    if a * a + b * b == c * c:
        rec += 1

print(rec)
print(loz)

Submission status: Accepted

Solution code:
tyo = 0
hisi = 0
while True:
    try:
        a,b,c = map(int, input().split(","))
        if c**2 == a**2+b**2 : tyo += 1
        if a == b: hisi += 1
    except EOFError:
        break
print(tyo)
print(hisi)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os


rectangle = 0
diamond = 0
parallelogram = 0

for s in sys.stdin:
    a, b, c = map(int, s.split(','))
    if a**2 + b**2 == c**2:
        rectangle += 1
    elif a == b:
        diamond += 1
    else:
        parallelogram += 1

print(rectangle)
print(diamond)

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !
import sys

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

Submission status: Accepted

Solution code:
import sys
t, h = 0, 0
for line in sys.stdin:
    try:
        a, b, c = line.split(",")
        if not int(a) ** 2 + int(b) ** 2 - int(c) ** 2:
            t += 1
        elif int(a) == int(b):
            h += 1
    except:
        break
print(t)
print(h)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
ans = [0, 0]
while  True:
    try:
        a, b, c = map(int, input().split(','))
    except:
        break
    if a**2 + b**2 == c**2:
        ans[0] += 1
    if a == b:
        ans[1] += 1
print(*ans, sep="\n")

Submission status: Accepted

Solution code:
import fileinput
triangle = 0
diamond = 0
for line in fileinput.input():
    if line == "\n":
        break
    else:
        a, b, c = map(int, line.split(","))
        if a**2 + b**2 == c**2:
            triangle += 1
        if a == b:
            diamond += 1
print(triangle)
print(diamond)

Submission status: Accepted

Solution code:
# Aizu Problem 0032: Plastic Board
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")

rectangles, lozenges = 0, 0
while True:
    try:
        a, b, c = [int(_) for _ in input().split(',')]
    except EOFError:
        break
    if a**2 + b**2 == c**2:
        rectangles += 1
    elif a == b:
        lozenges += 1

print(rectangles)
print(lozenges)

Submission status: Accepted

Solution code:
# 0032
n1 = n2 = 0
while True:
    try:
        a, b, c = map(int, input().split(','))
        if a**2 + b**2 == c**2:
            n1 += 1
        elif a == b:
            n2 += 1
    except EOFError: break
print(n1)
print(n2)

Submission status: Accepted

Solution code:
r = l = 0
while True:
    try:
        a, b, c = map(int, input().split(','))
        if a * a + b * b == c * c:
            r += 1
        elif a == b:
            l += 1
    except:
        break
print(r)
print(l)

Submission status: Accepted

Solution code:
import sys

rect = 0
rhom = 0
for line in sys.stdin:
  try:
    a, b, c = [int(i) for i in line.split(',')]
    if a**2 + b**2 == c**2:
      rect += 1
    elif a == b:
      rhom += 1
  except:
    break
print(rect)
print(rhom)

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
def main():
    Rec = 0
    Dia = 0
    while True:
        try:
            a,b,c = map(int,input().split(","))
            if a == b:
                Dia += 1
            elif a**2 + b**2 == c**2:
                Rec += 1
        except EOFError:
            break
    print('{}\n{}'.format(Rec,Dia))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
c_rec = 0
c_rho = 0
while True:
    try:
        a,b,c = map(int, input().split(","))
        if a**2 + b**2 == c**2:
            c_rec += 1
        elif a == b:
            c_rho += 1
    except:
        break
print(c_rec)
print(c_rho)

Submission status: Accepted

Solution code:
def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
ans1 = 0
ans2 = 0
for l in range(len(N)):
    a, b, c = [int(i) for i in N[l].split(",")]
    if a*a + b*b == c*c:
        ans1 += 1
    if a == b:
        ans2 += 1
print(ans1)
print(ans2)

Submission status: Accepted

Solution code:
import sys
r=d=0
for e in sys.stdin:
 a,b,c=map(int,e.split(','))
 if a*a+b*b==c*c:r+=1
 if a==b:d+=1
print(r)
print(d)

Submission status: Accepted

Solution code:
import sys
r=d=0
for e in sys.stdin:
 a,b,c=map(int,e.split(','))
 if a*a+b*b==c*c:r+=1
 if a==b:d+=1
print(f'{r}\n{d}')

Submission status: Accepted

Solution code:
rectangle=0
lozenge=0
while True:
	try:
		x,y,z=map(int, input().split(","))
		if x==y:
			lozenge+=1
		elif x**2+y**2==z**2:
			rectangle+=1
	except EOFError:
		break
print(rectangle)
print(lozenge)

Submission status: Accepted

Solution code:
import sys
def main():
    r = 0
    d = 0
    for line in sys.stdin:
        A = list(map(int, line.split(",")))
        if A[0] == A[1]:
            d += 1
        else:
            if A[0] ** 2 + A[1] ** 2 == A[2] ** 2:
                r += 1

    print(r)
    print(d)



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
x,y=0,0
for line in sys.stdin:
	a,b,c = map(int,line[:-1].split(','))
	if a*a + b*b == c*c:
		x += 1
	if a == b:
		y += 1
print("{}\n{}".format(x,y))

Submission status: Accepted

Solution code:
sq=ss=0
while 1:
	try: a,b,c=map(int,input().split(','))
	except: break
	if a**2 + b**2 == c**2:
		sq+=1
	elif a == b:
		ss+=1
print(sq)
print(ss)

Submission status: Accepted

Solution code:
import sys
f = sys.stdin
 
rhombus = oblong = 0
for line in f:
    a, b, c = map(int, line.split(','))
    if a == b:
        rhombus += 1
    if a * a + b * b == c * c:
        oblong += 1
 
print(oblong)
print(rhombus)

Submission status: Accepted

Solution code:
rect_num = 0
diam_num = 0

while True:
    try:
        a,b,c = map(int, input().split(','))
        if a**2 + b**2 == c**2:
            rect_num += 1
        elif a == b:
            diam_num += 1
    except EOFError:
        break

print(rect_num)
print(diam_num)

Submission status: Accepted

Solution code:
import sys
c=[]
l=[list(map(int,t.split(","))) for t in sys.stdin]
for i in l:
    if i[0]**2+i[1]**2==i[2]**2:
        c.extend([1])
    elif i[0]==i[1]:
        c.extend([2])
print("{}\n{}".format(
    len([i for i in c if i==1]),
    len([i for i in c if i==2])
    ))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# coding=utf-8


def is_rect(quadr):
    if quadr[0]**2 + quadr[1]**2 == quadr[2]**2:
        return True
    return False


def is_rhombus(quadr):
    if quadr[0] == quadr[1]:
        return True
    return False


if __name__ == '__main__':
    counter_list = [0, 0]
    while True:
        try:
            quadr = list(map(int, input().split(',')))
            if is_rect(quadr):
                counter_list[0] += 1
            if is_rhombus(quadr):
                counter_list[1] += 1
        except EOFError:
            break
    print(counter_list[0])
    print(counter_list[1])

Submission status: Accepted

Solution code:
# AOJ 0032 Plastic Board
# Python3 2018.6.15 bal4u

rect = loz = 0
while True:
	try:
		a, b, c = list(map(int, input().split(',')))
	except EOFError:
		break
		
	if a*a + b*b == c*c:
		rect += 1
	elif a == b and a + b > c and b + c > a:
		loz += 1
print(rect, loz, sep='\n')

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

import sys


def is_rectangle(side_a, side_b, diagonal):
    if side_a == side_b:
        return False
    return (side_a ** 2 + side_b ** 2) == diagonal ** 2


def is_rhombus(side_a, side_b, diagonal):
    if side_a != side_b:
        return False
    elif (side_a ** 2 + side_b ** 2) == diagonal ** 2:
        return False
    else:
        return True


def main():
    params = [[int(x) for x in line.split(",")] for line in sys.stdin.readlines()]
    rectangles = 0
    rhombuses = 0
    for param in params:
        if is_rectangle(*param):
            rectangles += 1
        elif is_rhombus(*param):
            rhombuses += 1

    print rectangles
    print rhombuses


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
rect,dia=0,0
for line in sys.stdin.readlines():
    a,b,c=map(int,line.strip().split(","))
    if a*a+b*b==c*c:rect+=1
    if a==b:dia+=1
print rect
print dia

Submission status: Accepted

Solution code:
r, d = 0, 0
while True:
    try:
        (a,b,c) = [int(i) for i in raw_input().split(',')]
    except:
        break
    if(a==b):
        d += 1
    if(a*a+b*b==c*c):
        r += 1
print r
print d

Submission status: Accepted

Solution code:
import sys
rect = 0
hisi = 0
for line in sys.stdin.readlines():
    x,y,z = map(int,line.split(','))
    if x**2 + y**2 == z**2:rect += 1
    elif x == y : hisi +=1

print rect
print hisi

Submission status: Accepted

Solution code:
import sys
rect,loz=0,0
for line in sys.stdin.readlines():
    x,y,z=map(int,line.rstrip().split(","))
    if x*x+y*y == z*z: rect+=1
    if x==y and z<x+y: loz+=1

print rect
print loz

Submission status: Accepted

Solution code:
cho=0
his=0
while True:
    try:
        x,y,r=map(int,raw_input().split(','))
    except EOFError:
        break
    if x == y:
        his+=1
    if r**2==(x**2+y**2):
        cho+=1
print cho
print his

Submission status: Accepted

Solution code:
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin

rectangle = diamond = 0
for line in stdin:
    try:
        a, b, c = (int(s) for s in line.split(','))
    except ValueError:
        break
    diamond += a == b
    rectangle += a ** 2 + b ** 2 == c ** 2
print(rectangle, diamond, sep='\n')

Submission status: Accepted

Solution code:
rectangles = 0 ; lozenges = 0
while True:
	try:
		a,b,c, = map(int,raw_input().split(','))
		if a*a + b*b == c*c: rectangles += 1
		else:
			if a == b: lozenges += 1
			else: pass
	except: break
print rectangles ; print lozenges

Submission status: Accepted

Solution code:
import sys
a=b=0
for line in sys.stdin:
    x,y,z=map(int,line.strip().split(","))
    if x*x+y*y==z*z:a+=1
    if x==y:b+=1
print "%d\n%d"%(a,b)

Submission status: Accepted

Solution code:

import sys


def rectangle_or_rhombus(a, b, c):
    if a**2 + b**2 == c**2:
        return 'rectangle'
    elif a == b:
        return 'rhombus'
    else:
        return 'other'


h = {'rectangle':0, 'rhombus':0, 'other':0}

for line in sys.stdin:
    (a, b, c) = tuple(map(int, line.split(',')))
    h[rectangle_or_rhombus(a,b,c)] += 1

print h['rectangle']
print h['rhombus']

Submission status: Accepted

Solution code:
import math

if __name__ == "__main__":
    rectangle = 0
    diamond = 0
    while True:
        try:
            x,y,z = map(int,raw_input().split(","))

            if x == y:
                diamond += 1

            if (pow(x,2)+pow(y,2)) == pow(z,2):
                rectangle += 1

        except EOFError:
            break

    print rectangle
    print diamond

Submission status: Accepted

Solution code:
r1, r2 = 0, 0
while True:
    try:
        a,b,c = map(int, raw_input().split(','))
        if (a**2 + b**2) == c**2:
            r1 += 1
        elif a == b:
            r2 += 1
    except EOFError:
        break
print r1
print r2

Submission status: Accepted

Solution code:
lozenge =0
rectangle =0

while True:
    try:
        a,b,c = map(int, raw_input().split(','))
    except:
        break

    if (a*a+b*b==c*c): rectangle +=1
    if (a==b): lozenge +=1
print rectangle
print lozenge

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
lect = 0
dia = 0
while True:
    try:
        a, b, c = map(int, raw_input().split(","))
        if a == b:
            dia += 1
        elif c**2 - a**2 - b**2 == 0:
            lect += 1
    except:
        break

print lect
print dia

Submission status: Accepted

Solution code:
import sys
rec = 0
loz = 0
 
for s in sys.stdin:
    a,b,c = map(int, s.split(','))
    if a*a+b*b==c*c: rec += 1
    if a==b: loz += 1
print rec
print loz

Submission status: Accepted

Solution code:
import sys
rec = 0
loz = 0
 
for s in sys.stdin:
    a,b,c = map(int, s.split(','))
    rec += (a*a+b*b==c*c)
    loz += (a==b)
print rec
print loz

Submission status: Accepted

Solution code:
r1, r2 = 0, 0
while 1:
    try:
        a, b, c = map(int, raw_input().split(','))
        if a ** 2 + b ** 2 == c ** 2:
            r1 += 1
        elif a == b:
            r2 += 1
    except:
        break
print r1
print r2

Submission status: Accepted

Solution code:
try:
    p = q = 0
    while True:
        a, b, c = map(int, raw_input().split(','))
        if a ** 2 + b ** 2 == c ** 2:
            p += 1
        if a == b:
            q += 1
except:
    pass
print p
print q

Submission status: Accepted

Solution code:
import sys,math
rect,rhom=0,0
for s in sys.stdin:
	side=map(int,s.split(','))
	if side[0]==side[1]:
		rhom+=1
	elif side[0]**2+side[1]**2==side[2]**2:
		rect+=1
print rect
print rhom,

Submission status: Accepted

Solution code:
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)