#include<iostream>
#include<cmath>
#include<bitset>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int cnt(int n){
	int res=0;
	for(int i=0;(1<<i)<=n;i++)if(n&(1<<i))res++;
	return res;
}

int sum(int n){
	int res=0;
	for(int i=0;(1<<i)<=n;i++){
		if((n&(1<<i))>0)res+=(i+1);
	}
	return res;
}

int main(){
	int n,k,s;
	while(cin>>n>>k>>s,n||k||s){
		int ans=0;
		rep(i,pow(2,n)){
			if(cnt(i)==k && sum(i)==s)ans++;
		}
		cout<<ans<<endl;
	}
	return 0;
}