grade_point_dict = {'A':4.0,'B':3.0,'C':2.0,'D':1.0,'F':0}
grade_point = [] 
score = []
while True:
    x = input()
    if x == 'False':
        break
    elif x in grade_point_dict.keys():
        grade_point.append(float(grade_point_dict[x]))
    else:
        score.append(float(x))
print(grade_point,score)
muti = lambda x,y:x*y #lambda相乘
muti_score = list(map(muti,grade_point,score)) #实现list相乘
print("The muti_score is ",muti_score,type(muti_score))
point_score = sum(muti_score)
sum_score = sum(score)
average = point_score/sum_score
#sum_score = 0
#for x in muti_score:
#    sum_score += x
print('%.2f'% average)