#include <cstdio>
#include <vector>
using namespace std;

int main(){
	int n, k, s;
	while(scanf("%d%d%d", &n, &k, &s), n){
		vector<vector<int> > dp(k + 1, vector<int>(s + 1));
		dp[0][0] = 1;
		for(int i = 1; i <= n; ++i)
		for(int j = k; j > 0; --j)
		for(int t = s; t >= i; --t){
			dp[j][t] += dp[j - 1][t - i];
		}
		printf("%d\n", dp[k][s]);
	}
}