def tenth(int a):
  if a % 10 == 0:
    return a
  else:
    a += 1

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

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