#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;

int ans ;

int n,k,s;

void dfs(int id,int tot,int sum){
    if(tot>k) return;
    if(sum<s&&(s-sum<id)) return;
    if(tot==k&&sum==s){
        ans++;
        return;
    }
    if(id>n||sum>s) return;
    dfs(id+1,tot+1,sum+id);
    dfs(id+1,tot,sum);
}

int main()
{
    while(~scanf("%d%d%d",&n,&k,&s)){
        if(n==0&&k==0&&s==0) break;
        ans=0;
        dfs(1,0,0);
        printf("%d\n",ans);
    }
    return 0;
}