#include <stdio.h>
#include <string.h>

int mem[21][11][156];
int n, k, s;

int dfs(int sum,int set_number,int pre_select_number){
  int ret = 0, i;
  if(mem[pre_select_number][set_number][sum] != -1){
    return mem[pre_select_number][set_number][sum];
  }
  if(set_number == k){
    if(sum == s){
      return 1;
    }else{
      return 0;
    }
  }
  for(i = pre_select_number + 1;i <= n;i++){
    ret += dfs(sum + i,set_number + 1,i);
  }
  return mem[pre_select_number][set_number][sum] = ret;
}


int main(void){
  while(1){
    scanf("%d%d%d",&n,&k,&s);
    if(n == 0 && k == 0 && s == 0){
      break;
    }
    memset(mem,-1,sizeof(mem));
    printf("%d\n",dfs(0,0,0));
  }
  return 0;
}