import java.util.Scanner object Main extends App { val sc = new Scanner(System.in) val d = sc.nextInt val a, b = sc.nextInt val ans = (0 to d).map(_ * (a - b) + d * b).min println(ans) }