#include <iostream>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;

int N[20];
int ans, sum, n, k, s;

void subsetsum(int x, int y)
{
  FOR(i,x,n){
    if(y){
      sum += N[i];
      subsetsum(i+1,y-1);
      if(sum == s && y == 1)
        ans++;
      sum -= N[i];
    }else{
      break;
    }
  }
}

int main()
{
  REP(i,20)
    N[i] = i+1;
  while(1){
    ans = sum = 0;
    cin >> n >> k >> s;
    if(n == 0 && k == 0 && s == 0) break;
    subsetsum(0,k);
    cout << ans << endl;
  }
}