#include <bits/stdc++.h>
#include <stdint.h>

typedef uint32_t u32;
typedef uint64_t u64;

int dfs(int remain_n, int remain_sum, int remain_choice) {
  if( remain_choice < 0 ) return 0;
  if( remain_n <= 0 ) {
    if( remain_sum == 0 and remain_choice == 0 ) return 1;
    return 0;
  }
  int res = 0;
  res += dfs(remain_n - 1, remain_sum, remain_choice);
  res += dfs(remain_n - 1, remain_sum - remain_n, remain_choice - 1);
  return res;
}

int main() {

  int dp[16][160];
  int n, k, s;

  while( std::cin >> n >> k >> s ) {
    if( n == 0 and k == 0 and s == 0 ) break;
    std::cout << dfs(n, s, k) << std::endl;       
  }
   
  return 0;
}