import sys from sys import stdin N,A,B = map(int,stdin.readline().split()) ans1 = A*(N-1) - B*N ans2 = -A*(N-1) - B*(N%2) print (min(ans1,ans2))