L = [int(input()) for _ in range(3)] for i in range(2, -1, -1): if i == 2: num = 25 elif i == 1: num = 4 elif i == 0: num = 10 q, r = divmod(L[i], num) if i > 0: L[i - 1] += q L[i] = r print(sum(L))