#include <stdio.h>


int solve(int n, int k, int s){
	unsigned int bit=1;
	int max=1<<n;
	int count=0,i,sum;
	while(bit<max){
		if(__builtin_popcount(bit)==k){
			sum=0;
			for(i=0;i<n;i++){
				if(1<<i&bit)sum+=i+1;
			}
			if(sum==s)count++;
		}
		bit++;
	}
	return count;
}

int main(void){
	int n,k,s;
	while(scanf("%d %d %d",&n,&k,&s),n|k|s){
		printf("%d\n",solve(n,k,s));
	}
	return 0;
}