#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
int main(){
	while(true){
		int n,k,s;
		scanf("%d%d%d",&n,&k,&s);
		if(n+k+s==0)break;
		int ans = 0;
		REP(msk,1<<n)if(__builtin_popcount(msk)==k){
			int x = 0;
			REP(i,n)if(msk>>i&1)x += (i+1);
			if(x==s)ans++;
		}
		printf("%d\n",ans);
	}
	return 0;
}
