#include<iostream>
#include<cstring>
#define rep(i,n) for(int i=0;i<(int)n;i++)
using namespace std;

int main(){
  int n,k,s;
  int dp[30][20][200];

  while(cin >> n >> k >> s,n||k||s){
    memset(dp,0,sizeof(dp));
    dp[0][0][0] = 1;

    rep(i,n){
      rep(j,k+1){
	rep(w,s+1){
	  dp[i+1][j][w] += dp[i][j][w];
	  if(j!=k && w+i+1<=s)dp[i+1][j+1][w+i+1] += dp[i][j][w];
	}
      }
    }

    cout << dp[n][k][s] << endl;
  }
}