#include <bits/stdc++.h>
using namespace std;
int calc(int prev,int n,int k,int s) {
    if(k==0) {
        return s==0;
    }
    if(s<0) return 0;
    int sum=0;
    for(int i=prev+1;i<=n;i++) {
        sum+=calc(i,n,k-1,s-i);
    }
    return sum;
}
int main() {
    int n,k,s;
    while(scanf("%d %d %d",&n,&k,&s),n) {
        printf("%d\n",calc(0,n,k,s));
    }
}