n, a, b = map(int, input().split()) if a <= b: ans = (n - 1) * (a - b) - b else: ans = 10**18 q, r = divmod(n, 2) ans = min(ans, (-a - b) * q - (a - b) * (q - 1 + r) - b * (-1)**(r + 1), -(a - b) * q + (-a - b) * (q - 1 + r) - b * (-1)**r) print(ans)