r=['A','B','C','D','F']
s=[4.0,3.0,2.0,1.0,0]
h=[]
while False not in r:
    a=input("")
    h.append(a)
    if a=='False':
        break  
i=0
while i<=4:
    r[i]=s[i]
    i=i+1
b=(int(h[1])*r[0]+int(h[3])*r[1]+int(h[5])*r[2])/(int(h[1])+int(h[3])+int(h[5]))
print(f"{b:.2f}")