A token for one metro trip costs UAH. If more trips are planned, then you can purchase a ticket, which price for trips is UAH, for - UAH, and for - UAH. What is the minimum sum you need to spend to pay for at least metro rides?
One positive integer (1 \le m \le 1000).
Print the required minimum sum.
Example 1