import java.util.Arrays;
import java.util.Scanner;

public class Main {
    private static int[][] dp;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int m = sc.nextInt();
        int n = sc.nextInt();
        dp = new int[m + 1][n + 1];
        System.out.println(dfs(m, n));
    }

    private static int dfs(int m, int n) {
        if (m == 0 || n == 1) return 1;
        if (dp[m][n] != 0) return dp[m][n];
        if (m < n) {
            return dp[m][n] = dfs(m, m);
        } else {
            return dp[m][n] = dfs(m, n - 1) + dfs(m - n, n);
        }
    }
}