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

long long n, k, s;
long long ans = 0;

void dfs (long long cnt, long long min, long long left, vector<long long> st){
	//cout<<"cnt: "<<cnt<<", st.size(): "<<st.size()<<endl;
	
	if (cnt > k || left < 0) {
		return;
	}
	if (left == 0 && cnt == k) {
		/*
	    for(auto itr = st.begin(); itr != st.end();) {
	        cout<<(*itr)<<", ";
	        itr++;
	    }
	    cout<<endl;
	    */
		
		ans++;
		return;
	}
	for(long long i=min; i<=n; i++){
		st.push_back(i);
		dfs(cnt+1, i+1, left-i, st);
		st.pop_back();
	}
	
	return;
}

int main() {
	while(1){
		cin>>n>>k>>s;
		if (n==0 && k==0 && s==0) break;
		ans = 0;
		
		vector<long long> st;
		dfs(0, 1, s, st);
		
		cout<<ans<<endl;
	}
	
	return 0;
}
