#include <bits/stdc++.h>

using namespace std;

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

    int ans = 0;
    for (int bit = 0; bit < (1 << n); bit++) {
      if (__builtin_popcount(bit) != k) {
        continue;
      }
      int res = 0;
      for (int i = 1; i <= n; i++) {
        if (bit & 1 << (i - 1)) {
          res += i;
        }
      }
      if (res == s) {
        ans++;
      }
    }
    cout << ans << endl;
  }

  return 0;
}
