#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <cmath>
#include <algorithm>
#include <functional>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
int main(){
	while(true){
		int n,k,s,ans=0;
		cin>>n>>k>>s;
		if(n==0) break;
		rep(i,1<<n){
			int cnt=0,sum=0;
			rep(j,n) if((i>>j)&1) cnt++,sum+=j+1;
			if(sum==s&&cnt==k) ans++;
		}
		cout<<ans<<endl;
	}
}