#include<bits/stdc++.h>

using namespace std;

set<vector<int>> res;

int n,k,s;
void search(vector<int> now, int m) {
    if(now.size() == k) {
        int sum=0;
        for(auto &e : now)
            sum += e;
        if(sum==s) res.insert(now);
        return;
    }
    for(int i=m+1; i<=n; i++) {
        vector<int> t(now);
        t.push_back(i);
        search(t, i);
    }
}

int main(void) {
    while(1) {
        cin>>n>>k>>s;
        if(!n) break;
        res.clear();
        search(vector<int>(), 0);
        cout<<res.size()<<endl;
    }
    return 0;
}