#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;

int main() {
  int n,k,s;
  // nは整数，kは集合の数，sは合計
  while(cin>>n>>k>>s,n&&k&&s) {
    int ans=0;
    for (int bits = 0; bits < (1<<n); bits++) {
      if (__builtin_popcount(bits)!=k) continue;
      int res=0;
      for (int i=1; i<n+1; i++) {
        if (bits & 1<<(i-1)) { res += i; }
      }
      if (res == s) ans++;
    }
    cout << ans << endl;
  }
}