def tenth(a):
  temp = a
  while True:
    if temp % 10 == 0:
      return temp
    else:
      temp += 1

a = tenth(int(input()))
b = tenth(int(input()))
c = tenth(int(input()))
d = tenth(int(input()))
e = int(input())

print(a + b + c + d + e)
