import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); long n = Long.parseLong(sa[0]); int a = Integer.parseInt(sa[1]); int b = Integer.parseInt(sa[2]); br.close(); long v1 = (n - 1) * a - n * b; long n1 = n / 2; long n2 = n - n1; long v2 = (n - 1) * -a + n1 * b - n2 * b; long ans = Math.min(v1, v2); if (n1 == n2) { n1--; n2++; long v3 = (n - 2) * -a + a + n1 * b - n2 * b; ans = Math.min(ans, v3); } System.out.println(ans); } }