#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int n,k,s;
int dfs(int pos,int sum,int cnt){
    if(pos>n){
        if(cnt==k&&sum==s)return 1;
        else return 0;
    }
    return dfs(pos+1,sum,cnt)+dfs(pos+1,sum+pos,cnt+1);
}
int main(){
    while(cin>>n>>k>>s,n||k||s){
        cout<<dfs(1,0,0)<<endl;
    }
    return 0;
}