#include<iostream>
using namespace std;

int num,cnt,sum,ans;

void func(int n,int i,int s){
  if(i==cnt && s==sum) ans++;
  if(i==cnt || n>num) return;
  func(n+1,i+1,s+n);
  func(n+1,i,s);
}

int main(void){
  while(cin >> num >> cnt >> sum,num!=0){
    ans=0;
    func(1,0,0);
    cout << ans << endl;
  }
}