#include<iostream>
#include<string>
#include<math.h>
using namespace std;
int main(){
	int n,k,s;
	while(true){
	    cin>>n>>k>>s;
		if(n==0&&k==0&&s==0)
			break;
		int count=0;
		if(n==0&&k==0&&s==0)
			break;
		for(int i=0;i<pow(2.0,n+0.0);i++){
			int scount=0,kcount=0;
			int bit=i;
			for(int j=1;j<=n;j++){
				if((bit&1)==1){
					scount+=j;
					kcount++;
				}
				bit=bit>>1;
			}
			if(scount==s&&kcount==k)
				count++;
		}
		cout<<count<<endl;
	}
	return 0;
}