#avgGrades
import re
import sys

args = sys.argv[1:]
line = ""
#sys.stdout.write(repr(sys.argv))
for x in args:
    line = line + " " + x
if line == "":
    sys.stdout.write("0.0")
else:    
    grades = re.findall("\\d+\.\\d+|\\d+", line)
    if len(grades) <= 0:
        sys.stdout.write("0.0")
    else:
        #sys.stdout.write("i'm here!")
        average = 0.0
        gradeTotal = 0.0
        index = 0
        totalWeight = 0.0
        for grade in grades:
            g = float(grade)
            weight = 1.0
            if index == len(grades)-1:
                weight = 1.5
            gradeTotal = gradeTotal + (g*weight)
            totalWeight = totalWeight + weight
            index = index + 1

        average = gradeTotal / totalWeight
        #print("Avg=",gradeTotal,"/",totalWeight)
        #sys.stdout.write("i'm here! ")
        sys.stdout.write(str(average))
