L = int(input()) M = int(input()) N = int(input()) # Convert 1-yen to 25-yen q, N = divmod(N, 25) M += q # Convert 25-yen to 100-yen q, M = divmod(M, 4) L += q # Convert 100-yen to 1000-yen (only remainder affects the coin count) L %= 10 # Sum the remaining coins print(L + M + N)