#include <iostream>

using std::cin;
using std::cout;
using std::endl;

int dfs(int n, int sum, int k, int sn) {
	int ret = 0;
	if (k == 0) {
		if (sn == sum) {
			return 1;
		}
		else {
			return 0;
		}
	}
	if (sn > sum || n == 0) {
		return 0;
	}

	ret += dfs(n-1, sum, k-1, sn+n);
	ret += dfs(n-1, sum, k, sn);
	
	return ret;
}

int main(void) {
	int n,k,s;
	cin >> n;
	cin >> k;
	cin >> s;

	while ( n != 0 || k != 0 || s!= 0 ) {
		int count = dfs(n,s,k,0);
		cout << count << endl;

		cin >> n;
		cin >> k;
		cin >> s;
	}

	return 0;
}