#include<iostream>
using namespace std;
int a[10],n,m,k,sum=0;
void check()
{
int tot=0;
for(int i=1;i<=k;i++)
tot+=a[i];
for(int i=2;i<=k;i++)
if(a[i]<a[i-1]) return;
if(m==tot) sum++;
}
void dfs(int t)
{
for(int i=1;i<=n;i++)
{
if(n-i>=0)
{
a[t]=i;
n-=i;
if(t==k) check();
else dfs(t+1);
n+=i;
}
}
}
int main()
{
cin>>n>>k;
m=n;
dfs(1);
cout<<sum<<endl;
return 0;
}