import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import static java.lang.Math.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map.Entry;
import java.util.StringTokenizer;
import java.util.TreeMap;

/**
 *
 * @author pttrung
 */
public class C {

    public static double Epsilon = 1e-6;
    public static long x, y, d;
    public static long MOD = 1000000007;
    public static int[][][] dp;
    public static int min, max, need;

    public static void main(String[] args) {

        Scanner in = new Scanner();
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int m = in.nextInt();
        min = Math.min(n, m);
        max = (m + n) - min;
        dp = new int[max][1 << min][1 << min];

        for (int[][] temp : dp) {
            for (int[] val : temp) {
                Arrays.fill(val, -1);
            }
        }
        need = (1 << min) - 1;
        //System.out.println(add + total);
        //  System.out.println(min + " " + max);

        out.println(cal(0, 0, 0));

        out.close();

    }

    public static int cal(int index, int last, int lastHold) {

        if (index == max) {
            return 0;
        }
        if (dp[index][lastHold][last] != -1) {
            return dp[index][lastHold][last];
        }
        int result = 0;

        for (int i = 0; i < 1 << min; i++) {
            if ((i | last) == need || (index == 0)) {
              //  System.out.println("PREV " + index + " " + i + " " + last + " " + lastHold);
              //  System.out.println("NEXT " + index + " " + i + " " + (i | lastHold) + " " + i);
                //   System.out.println(Integer.bitCount(i) + " " + i);

//                if (index == 3) {
//                    System.out.println(last + " " + i + " " + match(i, last) + " " + next);
//                }
                if(index + 1 == max && match(i,lastHold)!= need){
                    continue;
                }
     ... What is the time complexity of the previous code?