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

int solve(int n,int k,int s){
	if(k==0) return s==0?1:0;
	if(n==0 or s<0) return 0;
	return solve(n-1,k,s)+solve(n-1,k-1,s-n);
}

int main(){
	int n,k,s;
	while(cin>>n>>k>>s,n){
		cout<<solve(n,k,s)<<endl;
	}
	return 0;
}

