#include <iostream>

using namespace std;
int ans = 0;
int n, k, s;

void DFS(int num, int use, int sum)
{
	if (use > k || num > n + 1)
	{
		return;
	}
	if (use == k)
	{
		if (sum == s)
		{
			++ans;
		}
		return;
	}
	DFS(num + 1, use + 1, sum + num);
	DFS(num + 1, use, sum);
}

void solve()
{
	while (cin >> n >> k >> s, n || k || s)
	{
		ans = 0;
		DFS(1, 0, 0);
		cout << ans << endl;
	}
}

int main()
{
	solve();
	return(0);
}