#include <cstdio>
#include <cstdint>
#include <vector>

int testcase_ends() {
  int n, k, s;
  scanf("%d %d %d", &n, &k, &s);
  if (n == 0 && k == 0 && s == 0) return 1;

  int res = 0;
  for (int i = 0; i < (1 << n); ++i) {
    if (__builtin_popcount(i) != k) continue;
    int cur = 0;
    for (int j = 0; j < n; ++j) {
      if (i >> j & 1) cur += j+1;
    }
    if (cur == s) ++res;
  }
  printf("%d\n", res);
  return 0;
}

int main() {
  while (!testcase_ends()) {}
}

