l = int(input()) m = int(input()) n = int(input()) sum_of_cash = n + 25*m + 100*l total_coin = 0 sum_of_cash -= (sum_of_cash//1000)*1000 total_coin += sum_of_cash//100 sum_of_cash -= (sum_of_cash//100)*100 total_coin += sum_of_cash//25 sum_of_cash -= (sum_of_cash//25)*25 total_coin += sum_of_cash print(total_coin)