# -*- coding: utf-8 -*-
import math
# Input
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

list= [a, b, c, d, e]

i = 1
for ii in range(len(list) - 1):
    if list[i] % 10 == 0:
        k = list[i - 1]
        list[i - 1] = list[i]
        list[i] = k
    i += 1

count = 0
for ii in range(len(list)-1):
    if list[ii] % 10 == 0:
        count += list[ii]
    else:
        count += int(math.ceil(list[ii]/10) * 10)

count += list[len(list) - 1]
print(count)
