import sys

def precision(train,test):
	data_list=[]
	if len(train)!=len(test):
		print "Size Error"
		return -1
	else:
		for i in xrange(len(train)):
			if (train[i]==1 and train[i]==test[i]):
				data_list.append(1);
			else:
				data_list.append(0);
		if(sum(train)==0):
			x=1
		else:
			x=sum(train)
		return float(sum(data_list))/x	

def recall(train, test):
	data_list=[]	
	if len(train)!=len(test):
		print "Size Error"
		return -1
	else:
		for i in xrange(len(train)):
			if (train[i]==1 and train[i]==test[i]):
				data_list.append(1);
			else:
				data_list.append(0);
		if(sum(test)==0):
			x=1
		else:
			x=sum(test)
		return float(sum(data_list))/x

def fscore (precision, recall):
	if (precision+recall!=0):
		return 2*precision*recall/(precision+recall)
	else:
		return 0

def get_binary_list(word):
	bin_list=[]
	flag=0
	for i in xrange(len(word)):
		if(word[i]==' '):
			bin_list.append(1);
			flag=1;
		else:
			if(flag==1):
				flag=0;
			else:
				bin_list.append(0);
	#print bin_list
	return bin_list

f="output.txt"
big_train=[]
big_test=[]
correct=0
wrong=0
with open(f,'r') as f:
	for line in f:
		line=line.strip()
		[wtrain,wtest]=line.split('a');
		if(wtrain.decode(sys.stdin.encoding)==wtest.decode(sys.stdin.encoding)):
			correct=correct+1
		else:
			wrong=wrong+1
	prec=float(correct)/(float(correct+wrong))
	rec=float(correct)/(float(wrong))
	fscore=2*prec*rec/float(prec+rec)
	print "precision=",prec,"\nrecall=",rec,"\nfscore=",fscore
