#include <iostream>

using namespace std;

int N, K, S;

int dfs(int sum, int cnt, int max_)
{
	int total = 0;

	if (sum == S && cnt == K) { return 1; }

	if (cnt != K)
	{
		for (int i = max_ + 1; i <= N; i++)
		{
			total += dfs(sum + i, cnt + 1, i);
		}
	}

	return total;
}

int main()
{
	while (true)
	{
		cin >> N >> K >> S;

		if (N == 0 && K == 0 && S == 0) { break; }

		cout << dfs(0, 0, 0) << endl;
	}

	return 0;
}