#include <bits/stdc++.h>
using namespace std;
int main() {
  while (true) {
    int n, k, s;
    cin >> n >> k >> s;
    if (n == 0 && k == 0 && s == 0) {
      break;
    }
    int count = 0;
    std::string bitMask(k, 1);
    bitMask.resize(n, 0);
    do {
      int sum = 0;
      for (int i = 0; i < n; ++i) {
        if (bitMask[i]) {
          sum += i + 1;
        }
      }
      if (sum == s) {
        count += 1;
      }
    } while (std::prev_permutation(bitMask.begin(), bitMask.end()));
    cout << count << endl;
  }
}
