Subway rides#7818

Subway rides

1 second
128 megabytes
Medium

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?

Input

One positive integer (1 \le m \le 1000).

Output

Print the required minimum sum.

Examples

Example 1

Loading
Loading