ryouri = [int(input()) for i in range(5)]

order_1 = [i*0.1 - int(i*0.1) for i in ryouri]
min_v = sorted(order_1)[0]
min_id = 0
for i, v in enumerate(order_1):
    if v == min_v:
        min_id = i

goukei = 0
for i, (price, order) in enumerate(zip(ryouri, order_1)):
    if i == min_id:
        goukei = goukei + ryouri
    else:
        goukei = goukei + ryouri + 10

