#include int main() { long long int n, a, b; scanf("%lld %lld %lld", &n, &a, &b); long long int ans = (n - 1) * a - n * b; if (ans > (1 - n) * a - (n % 2) * b) ans = (1 - n) * a - (n % 2) * b; printf("%lld\n", ans); return 0; }