#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	for(int n, k, s; cin >> n >> k >> s && n;) {
		vector<vector<int>> dp(k + 1, vector<int>(s + 1, 0));
		dp[0][0] = 1;
		for(int i = 1; i <= n; ++i) {
			for(int j = s; j >= i; --j) {
				for(int l = k - 1; l >= 0; --l) {
					dp[l + 1][j] += dp[l][j - i];
				}
			}
		}
		cout << dp[k][s] << endl;
	}
	return EXIT_SUCCESS;
}