N,A,B = map(int,input().split()) if N%2==0: ans = min(A*(N-1)-B*N,-A*(N-1)) else: ans = min(A*(N-1)-B*N,-A*(N-1)-B) print(ans)