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

int main(){
  int n, k, s;
  while(cin >> n >> k >> s, n){
    int sum = 0;
    for(int i = 0; i < 1<<n; i++){
      int tmp = 0, cnt = 0;
      for(int k = 0; k < n; k++){
        if(i >> k & 1) tmp++;
      }
      if(tmp != k) continue;
      for(int j = 0; j < n; j++){
        if(i >> j & 1) cnt += j + 1;
      }
      if(cnt == s) sum++;
    }
    cout << sum << endl;
  }
  return 0;
}

