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

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

int MOD=1e9+7;
ll INF=1e18;

int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};

int main(){
    int n, k, s;
    while(cin>>n>>k>>s, n){
        int dp[25][15][400];
        memset(dp, 0, sizeof(dp));

        dp[1][0][0]=1;
        for(int i=1; i<=n; i++){
            for(int j=0; j<=k; j++){
                for(int l=0; l<=s; l++){
                    if(l+i<=s && j+1<=k) dp[i+1][j+1][l+i]+=dp[i][j][l];
                    dp[i+1][j][l]+=dp[i][j][l];
                }
            }
        }
        cout << dp[n+1][k][s] << endl;
    }
}
