# -*- 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]

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

print(count)
