#include <bits/stdc++.h>
using namespace std;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, k, s;
  while (cin >> n >> k >> s, n) {
    if (k > n) {
      cout << "0\n";
      continue;
    }
    s -= k;
    vector<int> a(n);
    fill(end(a) - k, end(a), 1);
    int res = 0;
    do {
      int sum = 0;
      for (int i = 0; i < n; ++i) {
        if (a[i]) {
          sum += i;
        }
      }
      res += sum == s;
    } while (next_permutation(begin(a), end(a)));
    cout << res << '\n';
  }
}

