L = int(input()) M = int(input()) N = int(input()) Mplus = N // 25 newN = N % 25 Lplus = (M+Mplus) // 4 newM = (M+Mplus) % 4 Oplus = (Lplus + L) // 10 newL = (Lplus + L) % 10 print(newN + newL + newM)