#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int t[25];
int n,k,s;
int dfs(int hukasa,int now,int used){//深さ、now
	//cout<<now<<endl;
	int ret=0;
	if(hukasa>=n){
	if(now==s&&used==k){ret=1;}
	return ret;
	}
	if(now)ret++;
	int a1=dfs(hukasa+1,now+t[hukasa],used+1);
	int a2=ret=dfs(hukasa+1,now,used);
	//cout<<"ret"<<ret<<endl;
	return a1+a2;
}
int main(){
	for(int i=0;i<25;i++)t[i]=i+1;

	while(true){
	cin>>n>>k>>s;
	if(n==0&&k==0&&s==0)break;
	cout<<dfs(0,0,0)<<endl;
	}
	return 0;
}