#include <iostream>
#include <algorithm>
using namespace std;

int main(){
  int n, k, s;

  while(cin >> n >> k >> s){
    if(n == 0) break;

    int ans = 0;

    for(int i = 1; i < (1 << n); i++){
      if(__builtin_popcount(i) != k) continue;

      int sum = 0;

      for(int j = 0; j < n; j++){
        if(!(i & (1 << j))) continue;
        sum += j + 1;
      }

      if(sum == s){
        ans++;
      }
    }

    cout << ans << endl;
  }
}