import java.lang.StringBuilder import java.util.* import kotlin.collections.ArrayList import kotlin.math.* fun main(args:Array) { /* val t = readLine()!!.toInt() repeat(t) { solve() } */ solve() } fun solve() { val (n, a, b) = readLine()!!.split(" ").map{it.toLong()}.toLongArray() val ans = min((n - 1) * a - b * n, -(n - 1) * a - if (n % 2 == 0L) 0 else b) println(ans) }