def gen(N): # 1,1,1,1.. yield N - 1, N # 1, -1, 1, -1, ... s = N // 2 t = N - s yield -(N - 1), s - t yield -(N - 1), t - s # -1, -1, ... yield N - 1, -N N, A, B = map(int, input().split()) print(min(A * x - B * y for x, y in gen(N)))