#include <cstdio>
#include <cstring>

int n,k,s;
int dp[31][15][190];
int main(void){
	while(1){
		scanf("%d %d %d",&n,&k,&s);
		if(n+k+s==0)break;
		memset(dp,0,sizeof(dp));
		dp[0][0][0]=1;
		for(int i=0;i<n;i++){
			for(int l=0;l<=k;l++){
				for(int j=0;j<=s;j++){
					if(dp[i][l][j]>0){
						dp[i+1][l][j]+=dp[i][l][j];
						dp[i+1][l+1][j+i+1]+=dp[i][l][j];
					}
				}
			}
		}
		printf("%d\n",dp[n][k][s]);
	}
	return 0;
}