#include<bits/stdc++.h>
using namespace std;
 
using ll=long long;
using pp=pair<int,int>;
#define sr string 
#define vc vector
#define db double
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define pb push_back
#define all(v) v.begin(),v.end()
#define pque priority_queue
#define bpc(a) __builtin_popcount(a)
int main(){
	ll n,a,b;cin>>n>>a>>b;
	ll ans=-(n-1)*a-(n&1)*b;
	ans=min(ans,a*(n-1)-b*n);
	if(n%2==0)ans=min(ans,-(n-3)*a-2*b);
	cout<<ans;
}