#include <bits/stdc++.h>

#define REP(i, n) for(int i = 0; i < (int) (n); i++)
#define ALL(v) (v).begin(), (v).end()
#define INF 1e9

using namespace std;

int dfs(int maxim, int left, int sum){
  int res = 0;
  if(left == 0 and sum == 0) return 1;
  for(int i=1; i<maxim; i++){
    if(sum < i) break;
    res += dfs(i, left-1, sum-i);
  }
  return res;
}

int main(){
  int n, k, s;
  while(cin >> n >> k >> s and n + k + s){
    int maxim = n+1;
    cout << dfs(maxim, k, s) << endl;
  }
  return 0;
}