#include <stdio.h>
int range;
int num;
int sum;
int ans;
void f(int n,int k,int s){
	int i;
	if(k==num){
		ans+=(s==sum);
		return ;
	}
	if(n>range){
		return ;
	}
	for(i=n;i<=range;i++){
		f(i+1,k+1,s+i);
	}
}
int main(void){
	while(1){
		scanf("%d %d %d",&range,&num,&sum);
		if(range==0){
			break;
		}
		ans=0;
		f(1,0,0);
		printf("%d\n",ans);
	}
	return 0;
}