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

int n,k,s,ans,sum;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> n >> k >> s,n){
        ans=0;
        for (int bit=0;bit<(1<<n);++bit){
            if (__builtin_popcount(bit)!=k) continue;
            sum=0;
            for (int i=0;i<n;++i){
                if (bit&1<<i) sum+=i+1;
            }
            if (sum==s) ++ans;
        }
        cout << ans << '\n';
    }
}
