#include <bits/stdc++.h>

using namespace std;
using i64 = long long int;
using ui64 = unsigned long long int;

////////////////////////////////

i64 dfs(int n,int k,int s){
  i64 ret = 0LL;
  if(k == 0){
    if(s == 0)return 1LL;
    else return 0LL;
  }
  for(int i=n-1;i>0;i--){
    ret += dfs(i,k-1,s-i);
  }
  return ret;
}

int main()
{
  int n,k,s;
  while(cin >> n >> k >> s,n && k && s){
    cout << dfs(n+1,k,s) << endl;
  }
  
}


