Probelm: Min Max (6 points)
Given a sequence of min and max operations, calculate the answer.
'M35' means max(3, 5) and the answer is 5.
'm62' means min(6, 2) and the answer is 2.
For a longer sequence such as 'M3mM42m56', it means
max( 3, min(max(4, 2), min(5, 6)))
and the answer is 4.
:)
A sequence of min and max operations.
Operands are integers in the range between 0 and 9.
'M' denotes max and 'm' denotes min.
There is a symbol '=' at the end of input.
No blanks between elements.
The length of input (including '=') is less than or equal to 40.
Print the answer.
No newline character at the end of output.