#include <iostream>
#include <string>
#include <vector>
#include <cstring>

using namespace std;
static int dp[21][12][200];

int main(){
	ios_base::sync_with_stdio(false);
	while(true){
		int n, k, s;
		cin >> n >> k >> s;
		if(n == 0 && k == 0 && s == 0){ break; }
		memset(dp, 0, sizeof(dp));
		dp[0][0][0] = 1;
		for(int i = 0; i < n; ++i){
			for(int j = 0; j <= k; ++j){
				for(int t = 0; t <= s; ++t){
					dp[i + 1][j][t] += dp[i][j][t];
					dp[i + 1][j + 1][t + i + 1] += dp[i][j][t];
				}
			}
		}
		cout << dp[n][k][s] << endl;
	}
	return 0;
}