#include<iostream>
#include<vector>
using namespace std;
const int N = 20;
int main(int argc, char *argv[])
{
  for(;;) {
    int n, k, s;
    cin >> n >> k >> s;
    if(n == 0 && k == 0 && s == 0) break;
    int cnt = 0;
    for(int i = 0; i < 1<<n; i++) {
      int c = 0, ss = 0;
      for(int j = 0; j < n; j++) {
        if(i & (1<<j)) { c++; ss+=(j+1); }
      }
      if(c == k && s == ss) cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}

