#include <iostream>
#include <cstring>

using namespace std;

int dp[21][11][156];

int main()
{
  int n, k, s;

  while (1) {
    cin >> n >> k >> s;
    if (n == 0 && k == 0 && s == 0) break;
    memset(**dp, 0, sizeof(dp));
    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 && j != 0) {
            dp[i + 1][j][l] += dp[i][j - 1][l - (i + 1)];
          }
        }
      }
    }
    cout << dp[n][k][s] << endl;
  }
}

  

