#include<iostream>
#include<vector>
#include<bitset>
#include<string.h>

using namespace std;

vector<int> ans;
const int max_dp = 1<<20;
int main(){
	while(true){
		int n,k,s;
		cin >> n >> k >> s;
		if(n == 0 && k == 0 && s == 0) break;
		
		int count = 0;
		for(int i = 0;i < (1<<n);i++){
			bitset<20> bs(i);
			int sum = 0;
			int used = 0;
			for(int j = 0;j < n;j++){
				if(bs[j]){
					sum += j+1;
					used++;
				}
			}
			if(used == k && sum == s) count++;
		}
		ans.push_back(count);
	}
	
	for(int i = 0;i < ans.size();i++){
		cout << ans[i] << endl;
	}
	return 0;
}
