using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); static void Main() { var c = NList; var (n, a, b) = (c[0], c[1], c[2]); var res = a * (n - 1) - b * n; if (n % 2 == 0) { var dbl = n / 2 - 1; if (a * 2 > b) res += (b - a * 2) * dbl * 2; if (a > b) res += (b - a) * 2; } else { var dbl = n / 2; if (a * 2 > b) res += (b - a * 2) * dbl * 2; } WriteLine(res); } }