#include<iostream>
#include<map>
#include<tuple>
using namespace std;

typedef tuple<int,int,int> T;
map<T,int> memo;

int dp(int n, int k, int s) {
  if (s < k || n < 1 || s < 1) {
    return 0;
  } else if (k == 1 && s <= n) {
    return 1;
  } else if (memo.find(make_tuple(n, k, s)) != memo.end()) {
    return memo[make_tuple(n, k, s)];
  } else {
    int ans = dp(n - 1, k, s - k) + dp(n - 1, k - 1, s - k);
    memo[make_tuple(n, k, s)] = ans;
    return ans;
  }
}

int main() {
  int n, k, s;
  while (cin >> n >> k >> s && n) {
    cout << dp(n, k, s) << endl;
  }
}