#include <iostream>
using namespace std;
int k, n;
long r;
void backtrack(long dep, long prev, long n){
long m;
if(dep == k){
if(n >= prev){
r++;
return ;
}
}
for(m = prev; m <= (n/2); m++)
backtrack(dep+1, m, n-m);
}
int main(){
while(cin>>n>>k){
r = 0;
backtrack(1, 1, n);
cout<< r << endl;
}
return 0;
}