#include<iostream>
using namespace std;
using lli = long long int;

lli dfs(int n, int k, int s, int sum = 0, int prev = 0, int depth = 0){
  if(s < sum)return 0;
  if(depth == k) return sum == s;
  lli res = 0;
  for (int i = prev + 1; i <= n; i++) {
    res += dfs(n, k, s, sum + i, i, depth + 1);
  }
  return res;
}

int main(){
  int n, k, s;
  while(std::cin >> n >> k >> s, n){
    std::cout << dfs(n, k, s) << std::endl;
  }
  return 0;
}


