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

int n, s, k;

int dfs(int i, int cnt, int total){
  if(cnt == k){
    return total == s ? 1 : 0;
  }else if(i > n){
    return 0;
  }

  int ret = 0;
  for(int j=i;j<=n;j++){
    if(total + j <= s){
      ret += dfs(j + 1, cnt + 1, total + j);
    }
  }

  return ret;
}

int main(){
  while(true){
    cin >> n >> k >> s;
    if(n == 0) break;
    cout << dfs(1, 0, 0) << endl;
  }
}