#include<iostream>
#include<vector>
using namespace std;

int main(){

    while(1){
        int N, K, S; cin >> N >> K >> S;
        if(!N) break;

        int dp[22][22][160] = {};      //dp[n][k][s] :=   n以下の数字をk個使ってsを作る組み合わせ
        dp[0][0][0] = 1;
        for(int n = 1; n <= N; n++){
            for(int k = 0; k <= K; k++){
                for(int s = 0; s <= S; s++){
                    if(s - n >= 0 && k != 0) dp[n][k][s] += dp[n - 1][k - 1][s - n];

                    dp[n][k][s] += dp[n - 1][k][s];
                }
            }
        }
        cout << dp[N][K][S] << endl;
    }

    return 0;
}
