#include int main() { long long N, A, B; scanf("%lld %lld %lld", &N, &A, &B); long long ans[2]; ans[0] = A * (1 - N) - B * (N % 2); ans[1] = A * (N - 1) - B * N; if (ans[0] < ans[1]) printf("%lld\n", ans[0]); else printf("%lld\n", ans[1]); fflush(stdout); return 0; }