// No.1517 Party Location package main import ( "fmt" "math" ) func main() { var d, a, b int fmt.Scan(&d, &a, &b) ans := math.MaxInt64 for i := 0; i <= d; i++ { ans = min(ans, i*a+(d-i)*b) } fmt.Println(ans) }