using System.Numerics; public class Program { public static void Main() { int num = int.Parse(Console.ReadLine() ?? string.Empty); string[] str = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); //string str = Console.ReadLine() ?? string.Empty; int a = int.Parse(str[0]); int b = int.Parse(str[1]); if(a == 0 || b == 0) { Console.WriteLine(0); } else { if((b-a)% 2 == 0) { if(a <= b) { int s = (b / 2) + 1; int cost = (s * a) + ((num - s) * b); Console.WriteLine(cost); } else { int s = b / 2; int cost = (s * a) + ((num - s) * b); Console.WriteLine(cost); } } else { int s = b / 2; int cost = (s*a) + ((num-s)*b); Console.WriteLine(cost); } } } }