Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

The problem statement has recently been changed. View the changes.

×
E. Generate a String

time limit per test

2 secondsmemory limit per test

512 megabytesinput

standard inputoutput

standard outputzscoder wants to generate an input file for some programming competition problem.

His input is a string consisting of *n* letters 'a'. He is too lazy to write a generator so he will manually generate the input in a text editor.

Initially, the text editor is empty. It takes him *x* seconds to insert or delete a letter 'a' from the text file and *y* seconds to copy the contents of the entire text file, and duplicate it.

zscoder wants to find the minimum amount of time needed for him to create the input file of exactly *n* letters 'a'. Help him to determine the amount of time needed to generate the input.

Input

The only line contains three integers *n*, *x* and *y* (1 ≤ *n* ≤ 10^{7}, 1 ≤ *x*, *y* ≤ 10^{9}) — the number of letters 'a' in the input file and the parameters from the problem statement.

Output

Print the only integer *t* — the minimum amount of time needed to generate the input file.

Examples

Input

8 1 1

Output

4

Input

8 1 10

Output

8

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/02/2021 09:58:40 (h1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|