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

int main() {
  for(int n, k, s; cin >> n >> k >> s && (n|k|s);) {
    int res = 0;
    for(int b = 0; b < (1<<n); ++b) {
      int sum = 0, num = 0;
      for(int i = 0; i < n; ++i) {
        if(b >> i & 1) {
          sum += i+1;
          num += 1;
        }
      }
      res += (sum == s && num == k);
    }
    cout << res << endl;
  }
  return 0;
}