#include <iostream>
#include <vector>
#include <cstdio>
#include <cassert>
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
using namespace std;
int ans;
int n,k,s;
vector<int> debug;
void checker(int st,int dep,int cnt);
int main() {
  while(true){
    cin >> n >> k >> s;
    if(n==0&&k==0&&s==0) break;
    ans=0;
    checker(0,1,0);
    cout << ans << endl;
  }
  return 0;
}

void checker(int st,int dep,int cnt){
  if(dep<k) REP(i,st,n){
      debug.push_back(i+1);
      checker(i+1,dep+1,cnt+i+1);
      debug.pop_back();
    }else REP(i,st,n) if(cnt+i+1==s){
      ans++;
      //      rep(j,k-1) cout << debug[j] << ",";
      //      cout << i+1 << endl;
    }
}