fn main() { let mut nab = String::new(); std::io::stdin().read_line(&mut nab).ok(); let nab: Vec = nab.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nab[0]; let a = nab[1]; let b = nab[2]; let mut result = -a * (n-1) - (n%2) * b; result = result.min(a * (n-1) - n * b); if n % 2 == 0 { result = result.min(-a * (n-3) - 2 * b); } println!("{}", result); }