#include <bits/stdc++.h>
using namespace std;
int main(){
  while (1){
    int n, k, s;
    cin >> n >> k >> s;
    if (n == 0 && k == 0 && s == 0){
      break;
    }
    vector<vector<vector<int>>> dp(n + 1, vector<vector<int>>(k + 1, vector<int>(s + 1, 0)));
    dp[0][0][0] = 1;
    for (int i = 0; i < n; i++){
      for (int j = 0; j <= k; j++){
        for (int l = 0; l <= s; l++){
          dp[i + 1][j][l] += dp[i][j][l];
          if (l + i + 1 <= s && j < k){
            dp[i + 1][j + 1][l + i + 1] += dp[i][j][l];
          }
        }
      }
    }
    cout << dp[n][k][s] << endl;
  }
}
