# ** 1ipa.xyz
# All=2, Types=1,  COMPLEX(100%): +3_1(100%)
# 31(100%)
# ** 1ipa_195_240.xyz
# All=1, Types=1,  TRIVIAL(0%): Unlink_1(100%)
# 01(100%)
# ** 5wyk_145_200.xyz
# All=100, Types=2,  COMPLEX(59%): +3_1(59%) Unlink_1(41%)
# 31(82%) 01(17%) 41(1%)


types = {"+3_1": "31", "-3_1":"31", "4_1": "41", "+5_2": "52", "-5_2": "52", "+3_1#+3_1": "820", "Unlink_1": "01"}

class Protein:
	def __init__(self,name=""):
		self.name = name
		self.h0 = ""
		self.h1 = ""
		self.h2 = ""
		self.h2_pr = 0
		self.k0 = ""
		self.k1 = ""
		self.k2 = ""
		self.k2_pr = 0

P = []
cl = 0

pr = Protein()

f = open("ex_result","r")
for l in f.readlines(): 
	ll = l.split()
	if l.startswith("C"): cl = int(ll[1])
	if l.startswith("*"):
		if P.name!="": P.append(pr) 
		pr = Protein(ll[1][:-4])
	if l.startswith("All"): 
		type = ll[3]
		t = types[type.split("(")[0]]
		if cl == 0: pr.h0 = t
		elif c==1: pr.h1 = t
		else:
			pr.h2 = t
			pr.h2_pr = int(type.split("(")[1][:-2])
		
	 
print P.size()
print P[0].name, P[0].h0
