L = int(input()) M = int(input()) N = int(input()) coin_num = [] if N < 25: coin_num.append(N) else: nq, nr = divmod(N, 25) coin_num.append(nr) M = M + nq if M < 4: coin_num.append(M) else: mq, mr = divmod(M, 4) coin_num.append(mr) L = L + mq if L < 10: coin_num.append(L) else: lq, lr = divmod(L, 10) coin_num.append(lr) print(sum(coin_num))