#include<stdio.h>

int n, k, s, ans;

void dfs(int num,int cnt,int sum){
  if(sum==s&&cnt==k) ans++;
  if(num>n) return;
  if(cnt==k) return;

  dfs(num+1, cnt+1, sum+num);
  dfs(num+1, cnt, sum);
}

int main(){

  while(scanf("%d %d %d", &n, &k, &s), n){
    ans=0;
    dfs(1,0,0);
    printf("%d\n", ans);
  }

  return 0;
}