n, a, b = map(int, input().split()) ans1 = (n - 1) * a - b * n ans2 = (n - 1) * a + b * n ans3 = -(n - 1) * a - (b & 1) ans4 = -(n - 1) * a + (b & 1) print(min(ans1, ans2, ans3, ans4))