#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<string>
#include<cstdio>
#include<queue>
#include<functional>
#include<tuple>
#include<iomanip>
#include<stack>
#include<cmath>
#define ll long long
using namespace std;
int cnt;
int rec(int n, int k, int s) {
	if (k == 0 && s == 0) return cnt + 1;
	if (n <= 0 || k <= 0 || s <= 0) return cnt;
	for (int i = k; i <= n; ++i) cnt=rec(i - 1, k - 1, s - i);
	return cnt;
}
int main() {
	int n, k, s;
	while (cin >> n >> k >> s && n&&k&&s) {
		cnt = 0;
		cout << rec(n, k, s) << endl;
	}
	return 0;
}
