#include <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <string> 
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>

using namespace std;

int counter(int n, int k, int s);

int main()
{
	int n, k, s;
	while(1){
		cin >> n >> k >> s;
		if(n == 0 && k == 0 && s == 0) break;
		int cnt = 0;
		cnt = counter(n+1, k, s);
		cout << cnt << endl;
	}
	return 0;
}

int counter(int n, int k, int s)
{
	int ans = 0;
	if(s < 1) ans = 0;
	else if(k > 1){
		for(int i = n - 1; i > 1; i--){
			ans += counter(i, (k - 1), (s - i));
		}
	} else if(k == 1){
		if(s < n && 0 < s) ans = 1;
		else ans = 0;
	}
	return ans;
}