#include<bits/stdc++.h>
using namespace std;

unsigned foo(unsigned n, unsigned k, unsigned s, unsigned temp,int m){
	unsigned ans = 0;//cout<<n<<" "<<k<<" "<<s<<" "<<temp<<" "<<m<<endl;
	if(k==0){
		if(temp == s) return 1;
		else return 0;
	}
	for(int i = m; i <= n; i++){
		ans += foo(n,k-1,s,temp+i,i+1);
	}
	return ans;
}

int main(){
	unsigned n, k, s;
	
	while(1){
		cin>>n>>k>>s;
		if(!n&&!k&&!s)break;
		cout<<foo(n,k,s,0,1)<<endl;
	}
	return 0;
}
