#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

#time_residual = [i%10 for i in time]
# print(time_residual)

#time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

#ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
#print(ans)