L = int(input()) M = int(input()) N = int(input()) # Step 1: Convert 1 yen to 25 yen coins q = N // 25 M += q N %= 25 # Step 2: Convert 25 yen to 100 yen coins p = M // 4 L += p M %= 4 # Step 3: Convert 100 yen to 1000 yen notes r = L // 10 L %= 10 print(L + M + N)