L = int(input()) M = int(input()) N = int(input()) while N >= 25: if N >= 1000: N -= 1000 elif N >= 100: N -= 100 L += 1 elif N >= 25: N -= 25 M += 1 while M * 25 >= 100: if M * 25 >= 1000: M -= 40 elif N * 25 >= 100: M -= 4 L += 1 while L * 100 >= 1000: if L * 100 >= 1000: L -= 10 print(N+M+L)