CSES - KILO 2016 5/5 - Number
  • Time limit: 1.00 s
  • Memory limit: 512 MB

Uolevi has a new job. As the first task in the job, he got a positive integer number xx and he has to transform it into 00. Uolevi can do two kinds of operations:

  • Divide the number by 22 and round down. This costs aa euros.
  • Decrease the number by 11. This costs bb euros.

Find the minimum cost to transform the number into 00.

Input

The input contains three integers, xx, aa and bb.

Output

Output the minimum cost to transform the number into 00.

Constraints

  • 1x1091 \le x \le 10^9
  • 1a1091 \le a \le 10^9
  • 1b1091 \le b \le 10^9

Examples

Input:

3 5 3

Output:

8

Input:

5 10 1

Output:

5