#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define MOD 1000000007
#define ALL(a) (a).begin(),(a).end()
#define pb(x) push_back(x)
#define ms(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(10) 
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef long long ll;
struct edge{ int from, to, cost; };

int n, k, s;

int solve(int n, int k, int s)
{
	if (s < 0) return 0;
	if (n < 0) return 0;
	if (k == 0)
	{
		if (s == 0) return 1;
		else return 0;
	}
	return solve(n - 1, k - 1, s - n) + solve(n - 1, k, s);

}

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