~/algor $ cat problems/avtoturargoh-tolovi
Parking fee
Medium
1000 ms
64 MB
41%
At a car park, the first $60$ minutes are free. After that, $p$ soums are charged for every started hour: for example, a car that stayed $61$ minutes pays $p$ soums, and one that stayed $121$ minutes pays $2 * p$ soums. But the fee for a day never exceeds $M$ soums: if the computed amount is larger than $M$, $M$ soums are paid. A car stayed $t$ minutes. Find the fee.
Input
One line with three positive integers: $t$, $p$ and $M$.
Output
One integer — the fee.
Note
$1 \le t \le 1440$
$1 \le p \le 10^{5}$
$1 \le M \le 10^{6}$
Examples
Input #1
150 3000 10000
Output #1
6000
Input #2
1440 3000 20000
Output #2
20000