#include<iostream>
using namespace std;
int n,k,s;
int dfs(int now,int less,int u)
{
	if(!less)return now==0;
	else
	{
		int cnt=0;
		for(int i=u+1;i<=n&&i<=now;i++)
		{
			cnt+=dfs(now-i,less-1,i);
		}
		return cnt;
	}
}
int main()
{
	while(cin>>n>>k>>s,n)
	{
		cout<<dfs(s,k,0)<<endl;
	}
}

