#include <bits/stdc++.h>
using namespace std;
template <typename T, std::size_t N>
struct _v_traits {
  using type = std::vector<typename _v_traits<T, N - 1>::type>;
};
template <typename T>
struct _v_traits<T, 1> {
  using type = std::vector<T>;
};
template <typename T, std::size_t N = 1>
using vec = typename _v_traits<T, N>::type;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[";
  for (const auto &v : vec) {
    os << v << ",";
  }
  os << "]";
  return os;
}
long long dfs(long long upper, long long want, long long rest,
              long long greater_than, vec<long long, 3> &memo) {
  if (memo[want][rest][greater_than] != -1) {
    return memo[want][rest][greater_than];
  }
  if (rest == 1) {
    return greater_than <= want and want <= upper;
  }
  long long ret = 0;
  for (long long i = greater_than; i <= min(upper, want); i++) {
    ret += dfs(upper, want - i, rest - 1, i + 1, memo);
  }
  return memo[want][rest][greater_than] = ret;
}
long long solve(long long n, long long k, long long s) {
  vec<long long, 3> memo(s + 1,
                         vec<long long, 2>(k + 1, vec<long long>(n + 2, -1)));
  return dfs(n, s, k, 1, memo);
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  while (true) {
    long long n, k, s;
    cin >> n >> k >> s;
    if (n == 0 and k == 0 and s == 0) return 0;
    cout << solve(n, k, s) << endl;
  }
  return 0;
}
