#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;

int n, k, s;

ll solve(int c, int dk, int sum) {
	if(dk == k) {
		if(sum == s) {
			return 1LL;
		} else {
			return 0LL;
		}
	}
	ll res = 0;
	for(int i=c; i<=n && i<=s-sum; i++) {
		res += solve(i+1, dk+1, sum+i);
	}
	return res;
}

int main() {
	while(cin >> n >> k >> s, n || k || s) {
		cout << solve(1, 0, 0) << endl;
	}
	return 0;
}