order = [int(input()) for _ in range(5)]

for i in range(len(order)):
  time = 0
  for j in range(len(order)-i):
    if order[j+i]%10 == 0:
    	time += order[j]
  	else:
    	time += (order[j]//10+1)*10