import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main{ public static void main(String[] args)throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

    String str = null;
   
    while((str = in.readLine()) != null){
        String[] s = str.split(" ");
        int m = Integer.parseInt(s[0]);
        int n = Integer.parseInt(s[1]);
        System.out.println(putApple(m,n));
    }
    
}
public static int putApple(int m,int n){
    if(m == 0) return 1;
    if(n == 0) return 0;
    if(m < n) return putApple(m,m);
    else return putApple(m - n,n) + putApple(m,n-1);
}

}