#include<bits/stdc++.h>
using namespace std;
int N, K, S;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    while(true) {
        cin >> N >> K >> S;
        if(N == 0) break;
        int ans = 0;
        for(int i = 0; i < (1 << N); i++) {
            int now = 0;
            int num = 0;
            for(int j = 0; j < N; j++) {
                if(i & (1 << j)) {
                    num++;
                    now += j + 1;
                }
            }
            ///cerr << i << " " << num <<
            if(num == K && now == S) ans++;
        }
        cout << ans << endl;
    }
    return 0;
}
