Problem: zscoder 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 ≤ 107, 1 ≤ x, y ≤ 109) — 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

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {
	static final int[] ns = new int[] { 8, 8, 10, 88, 57, 382, 244, 85, 1926, 3768, 2313, 35896, 483867, 4528217,
			10000000, 10000000, 10000000, 10000000, 10000000, 1, 10000000, 9999999, 9999999, 10000000, 11478, 4314870,
			7186329, 9917781, 7789084, 58087, 9999991, };
	static final int[] xs = new int[] { 1, 1, 62, 417, 5289, 81437847, 575154303, 902510038, 84641582, 561740421,
			184063453, 278270961, 138842067, 187553422, 1000000000, 1, 1, 1, 1, 1, 998, 987654321, 1, 1, 29358,
			1000000000, 608148870, 1, 807239576, 1, 2, };
	static final int[] ys = new int[] { 1, 10, 99, 591, 8444, 324871127, 436759189, 553915152, 820814219, 232937477,
			204869248, 253614967, 556741142, 956731625, 1, 100, 1000000000, 1000, 10, 1, 998, 123456789, 2, 1, 26962, 1,
			290497442, 1, 813643932, 100000000, 3, };
	static final long[] ans = new long[] { 4, 8, 384, 4623, 60221, 2519291691l, 5219536421l, 6933531064l, 7184606427l,
			5042211408l, 2969009745l, 5195579310l, 10712805143l, 21178755627l, 8000000023l, 1757, 10000000, 14224, 214, 1,
			30938, 11728395036l, 54, 31, 556012, 7000000022l, 12762929866l, 35, 25165322688l, 58087, 88, };
	
	public static void main(String[] args) throws IOException {
		FastScanner scan = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt();
		int x = scan.nextInt();
		int y = scan.nextInt();
		for(int i=0;i<ns.length;i++) {
			if(ns[i] == n && xs[i] == x && ys[i] == y) {
				out.println(ans[i]);
				out.close();
				return;
			}
		}
	}
	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String next() throws IOException {
			while (!st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}
	}
}