#include<iostream>
#include<vector>
using namespace std;
const int N = 20;

int rec(int n, int k, int s)
{
  if(s < 0) return 0;  // no answer
  if(k == 0) return s == 0 ? 1 : 0; // 0 by 0?
  if(n > k) {
    // using n, or not using n
    return rec(n-1, k-1, s-n) + rec(n-1, k, s);
  } else if(n == k) {
    if( s == n * (n+1) / 2 ) return 1;
  }
  return 0;
}
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;
}

