#include<iostream>
#include<vector>
#include<string>
using namespace std;

#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define rep(i,n) FOR((i),0,(n))

typedef long long ll;

const int INF=1e9+7;

int solve(int now,int pre,int d,int n,int k,int s){
	if(now>s ||d>k)return 0;
	if(now==s && d==k)return 1;
	int re=0;
	FOR(i,pre+1,n+1)re+=solve(now+i,i,d+1,n,k,s);
	return re;
}

int main(){
	int n,k,s;
	while(cin>>n>>k>>s &&n){
		cout<<solve(0,0,0,n,k,s)<<endl;
	}
}