A = [ input() for i in range(3) ] L = int( A[0] ) M = int( A[1] ) N = int( A[2] ) X = L + 25 * M + 100 * N cal = X % 1000 a100 = int( cal / 100 ) cal = cal % 100 a25 = int( cal / 25 ) cal = cal % 25 a1 = cal print( a1 + a25 + a100 )