#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++) 
using namespace std;

int main() {
  for (int n, k, s; cin >> n >> k >> s, n;) {
    int ans = 0;
    REP(b, 1 << n) {
      if (__builtin_popcount(b) != k) continue;
      int sum = 0;
      REP(i, n) {
        if (b >> i & 1) sum += i + 1;
      }
      if (sum == s) ans++;
    }
    cout << ans << endl;
  }
}

