# import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') from collections import * from itertools import * from functools import * import math,sys input = sys.stdin.readline N,A,B = map(int,input().split()) X = (A-B)*N - A if N%2==0: Y = -A*(N-1) else: Y = -A*(N-1)-B print(min(X,Y))