#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)

using namespace std;

int dfs(int k, int last, int rest){
    if(k == 0 && rest == 0) return 1;
    if(k == 0) return 0;
    int res = 0;
    for(int i = last - 1; i > 0; i--){
        if(rest - i >= 0){
            res += dfs(k - 1, i, rest - i);
        }
    }
    return res;
} 
int main(){
    int N, K, S;
    while(cin >> N >> K >> S && N){
        cout << dfs(K, N + 1, S) << endl;
    }
    return 0;
}