a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
l = [a,b,c,d,e]
h = 0
for i in range(0, 5):
    f = l[i] // 5
    g = l[i] % 5
    if not(g == 0):
        f = f + 1
    f = f * 5
    h = h + f
print(h)