#include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

int getans(int sum, int amax, int rest) {
	if (sum < rest)return 0;
	if (sum > rest*amax)return 0;
	if (rest == 1) {
		if (1 <= sum&&sum <= amax)return 1;
	}
	int ans = 0;
	for (int i = 1; i <= amax; ++i) {
		ans += getans(sum - i, i - 1, rest - 1);
	}
	return ans;
}

int main() {
	while (1) {
		int N, K, S; cin >> N >> K >> S;
		if (!N)break;
		int ans(getans(S, N, K));
		cout << ans << endl;
	}
	return 0;
}