#include <bits/stdc++.h>
using namespace std;

long long int saiki( long long int N, long long int K, long long int S, long long int now ) {
	if( K == 0 ) {
		return S == 0;
	}
	long long int ret = 0;
	for( long long int i = now + 1; i <= N&&S - i >= 0; i++ ) {
		ret += saiki( N, K - 1, S - i, i );
	}
	return ret;
}

int main() {
	long long int N, K, S;
	while( cin >> N >> K >> S, N || K || S ) {
		cout << saiki( N, K, S, 0 ) << endl;
	}
}