#include <iostream>
#include <iostream>
using namespace std;
int n,k,s,flg,cnt;

void saiki(int kai,int sum,int p) {
  if(kai == k && sum == s) cnt++;
    if(kai < k && sum < s) {
      for(int i=p+1;i<=n;i++) saiki(kai+1,sum+i,i);	
    }
}

int main() {

  while(1) {
  cin >> n >> k >> s;
  if(n==0 && k==0 && s==0) break;
  cnt = 0;
  saiki(0,0,0);
  cout << cnt <<endl;
  }
  return 0;
}
    