#include<iostream>
#include<vector>
using namespace std;

// simple recursion
int rec(int n, int k, int s)
{
  if(s < 0) return 0;  // no answer
  if(k > n) return 0;  // less elements remain
  if(k == 0) return s == 0 ? 1 : 0; // 0 by 0?
  // using n, or not using n
  return rec(n-1, k-1, s-n) + rec(n-1, k, s);
}
int main(int argc, char *argv[])
{
  for(;;) {
    int n, k, s;
    cin >> n >> k >> s;
    if(n == 0 && k == 0 && s == 0) break;
    int cnt = 0;
    if(k <= n) {
      cnt = rec(n, k, s);
    }
    cout << cnt << endl;
  }
  return 0;
}

