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

int memo[21][11][156];

int rec(int n, int k, int s){
    if(n == 0 || k == 0) return (k==0 && s==0 ? 1 : 0);
    // if(memo[n][k][s] != -1) return memo[n][k][s];
    int res = 0;
    for(int i=1;i<=min(n,s);i++){
        res += rec(i-1, k-1, s-i);
    }
    return memo[n][k][s] = res;
}

bool solve(){
    int n, k, s;
    cin >> n >> k >> s;
    if(n == 0) return true;
    memset(memo, -1, sizeof(memo));
    cout << rec(n, k, s) << endl;
    return false;
}

int main(){
    while(!solve());
    return 0;
}
