#include <stdio.h>

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

int main (){
	int n, k, s;

	while (1) {
		scanf("%d %d %d", &n, &k, &s);
		if(n == 0 && k == 0 && s == 0)
			return 0;
		printf("%d\n", Con(n, k, s));
	}
}

