def tenth(int a):
  temp = a
  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)
