/* 
   AOJ 1335
   Equal Sum Sets
   2015/8/6
*/

#include<stdio.h>

int count = 0;

void dfs(int n, int k, int s, int m)
{
  int max_n = n, num = k, sum = s, min = m, i, j;
  
  //  printf("%d %d %d %d\n", n, k, s, m);
  
  if(num == 1)
    {
      if(min < sum && sum <= max_n)
	{
	  count++;
	  //	  printf("FUCK!!\n");
	}
      return ;
    }
  
  for(i = min + 1; i <= max_n; i++)
    {
      dfs(max_n, num - 1, sum - i, i);
    }
}


int main(void)
{
  int n, k, s, ans;

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