N,A,B = map(int,input().split()) print(min((N-1)*A-N*B,(1-N)*A-B*N%2))