import math

num = [input() for _ in range(5)]
num2 = sorted([list(i)[-1] for i in num],reverse = False)

num3 = [n for n in num2 if n != "0" ]



C = 0
c = 1

for i in num:
	j = list(i)[-1]
  
	if j == num3[0] and c == 1:
		C += int(i)
		c += 1
	elif c>1:
		if int(j) >= 5 or int(j) == 0:
			C += round(int(i),-1)
			#print(round(C))
			
                  
		elif 0< int(j) < 5:
			C += round(int(i),-1)+10		
        
        
	else:
		if int(j) >= 5 or int(j) == 0:
			C += round(int(i),-1)
			#print(round(C))
			
                  
		elif 0< int(j) < 5:
			C += round(int(i),-1)+10	
		#	print(round(C))


print(C)