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

#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
typedef pair<int,int> P;

//-----------------------------------------------------------------------

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n,k,s;
    while(cin>>n>>k>>s,n)
    {
        int ans=0;
        REP(b,1<<n){
            if(__builtin_popcount(b)!=k) continue;
            int sum=0;
            REP(i,n){ 
                if(b>>i&1) sum+=i+1;
            }
            if(sum==s) ans++;
        }
        cout<<ans<<endl;
    }
}

