A = [ input() for i in range(3) ] L = int( A[0] ) M = int( A[1] ) N = int( A[2] ) print( L + 25*M + 100*N ) dx = int( L/25 ) L = L - dx * 25 M = dx + M dx = int( 25 * M / 100 ) M = M - dx * 4 N = dx + N dx = int( 100 * N / 1000 ) N = N - dx * 10 O = dx print( L + M + N )