#include <iostream>
#include <algorithm>
using namespace std;
using ll = long long;

int main(){
    ll n, a, b; cin >> n >> a >> b;
    if(n%2 == 1){
        ll ans = (n-1)*a - n*b;
        ans = min(ans, -(n-1)*a-b);
        cout << ans << endl;
    }else{
        ll ans = (n-1)*a - n*b;
        ans = min(ans, -(n-1)*a);
        ans = min(ans, a*(3-n)-b*2);
        cout << ans << endl;
    }
    return 0;
}