#include <iostream>
using namespace std;

int dfs(int n, int k, int s, int now) {
  if (s < 0) return 0;
  if (s == 0) {
    if (k == 0) return 1;
    return 0;
  }
  if (now == n + 1) {
    if (s == 0) return 1;
    return 0;
  }
  return dfs(n, k - 1, s - now, now + 1) + dfs(n, k, s, now + 1);
}

int main() {
  while (true) {
    int n, k, s;
    cin >> n >> k >> s;
    if (n == 0 && k == 0 && s == 0) return 0;

    int count = dfs(n, k, s, 1);
    cout << count << endl;
  }
}