#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; i++)

typedef long long ll;
using namespace std;
int mod = 1000000007;

int solve(int dlim, int k, int rem, int n){
    if(k == 1){
        if(rem <= n && dlim < rem) return 1;
        else return 0;
    }
    int ret = 0;
    for(int i = dlim+1; i <= n; i++){
        ret += solve(i, k-1, rem-i, n);
    }
    return ret;
}

int main(void){
    int n, k, s;
    while(true){
        cin >> n >> k >> s;
        if(n == 0) break;
        cout << solve(0, k, s, n) << endl;
    }
    return 0;
}
