import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); long n = sc.nextInt(); long m = sc.nextInt(); sc.close(); if (n % 2 == 0) { System.out.println(n * m); } else { long v1 = (n - 1) * m; long v2 = 1; while (v2 <= m) { v2 *= 2; } v2--; v2 -= m; System.out.println(v1 + v2 * 2); } } }