#include <iostream>

using namespace std;
#define N 33000

int ans;

void solve(int n,int k,int s,int before,int cnt,int sum,int *data){	

	if(sum>s){
		return;
	}

	if(cnt==k){
		/*
		for(int i=0;i<cnt;i++){
			cout<<data[i]<<" ";
		}
		cout<<endl;
		*/
		if(sum==s){
			ans++;
		}
		return;
	}
	for(int i=before+1;i<=n;i++){
		data[cnt] = i;
		solve(n,k,s,i,cnt+1,sum+i,data);
	}
}

int main(){

	int n,k,s;
	int *data;
	data = new int[30];

	while(cin>>n>>k>>s){
		if(n==0 && k==0 && s==0)break;
	
		ans=0;

		solve(n,k,s,0,0,0,data);

		cout<<ans<<endl;
	}

	return 0;
}
		