#include <iostream>
#include <algorithm>
using namespace std;
int tbl[30][13][160];
int solve(int n,int k,int s){
  if(k==0 && s==0) return 1;
  if(k<0 || s<0) return 0;
  if(tbl[n][k][s]) return tbl[n][k][s];
  int ret = 0;
  for(int i=n;i>=1;--i){
    ret+=solve(i-1,k-1,s-i);
  }
  return tbl[n][k][s]=ret;
}
int main(){
  int n,k,s;

  while(cin>>n>>k>>s,n||k||s){
    cout << solve(n,k,s) << endl;
  }
  return 0;
}