L = int(input()) M = int(input()) N = int(input()) O = 0 if N >= 25: M += N // 25 N -= 25 * (N // 25) if M >= 4: L += M // 4 M -= 4 * (M // 4) if L >= 10: O += L // 10 L -= 10 * (L // 10) print(N + M + L)