#include <iostream>
using namespace std;
//递归
int num(int m, int n){
    if (m == 0 || m == 1 || n == 1){
        return 1;
    }
    if (m < n){ 
        return num(m, m);
    }//苹果多于盘子
    return num(m, n - 1) + num(m - n, n);
}
int main() {
    int m, n;  //n个盘子,m个苹果
    while (cin >> m >> n) { 
        cout << num(m, n) << endl;
    }
    return 0;
}