#include <bits/stdc++.h>
using namespace std;
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;
      while (i != 0) {
        int x = i & -i;
        i ^= x;
        ss += __builtin_ffs(x);
        c++;
      }
      if (c == k && s == ss) cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}
