#include <stdio.h>

int solve(int n, int k, int s){
	int i;
	if(s<0)return 0;
	if(!k){
		return s?0:1;
	}
	int cnt=0;
	for(i=n;i>0;--i){
		cnt+=solve(i-1,k-1,s-i);
	}
	return cnt;
}

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