#include <iostream>
#define N 20
using namespace std;
int n,k,s,C;
void Ess(int,int,int);
int main(){
  bool r;
  while(1){
    cin >> n >> k >> s;
    if(n==0&&k==0&&s==0) break;
    C=0;
    Ess(0,0,0);
    cout << C << endl;
  }
  return 0;
}
void Ess(int x,int sum,int cnt){
  if(n==x){
    if(cnt==k&&sum==s) C++;
    return ;
  }
  Ess(x+1,sum,cnt);
  Ess(x+1,sum+x+1,cnt+1);
}