L = int(input()) # 100円 M = int(input()) # 25円 N = int(input()) # 1円 count = 0 M = M + N // 25 count = N % 25 L = L + M // 4 count = count + M % 4 count = count + L % 10 print(count)