from itertools import product def gen_small(N): for p in product([-1, 1], repeat=N): x = sum([s * t for s, t in zip(p, p[1:])]) y = sum(p) yield x, y N, A, B = map(int, input().split()) if N < 20: print(min(A * x - B * y for x, y in gen_small(N))) exit() ans = (N - 1) * A - N * B d = (N - 1) // 2 x = (N - 1) - 4 * d y = N - 2 * d ans = min(ans, A * x - B * y) if N % 2 == 0: x -= 2 y -= 2 ans = min(ans, A * x - B * y) print(ans)