#include <iostream>
using namespace std;
int main() {
  int n, k, s, ans, t, u;
  while (cin >> n >> k >> s, n) {
    int A[k];
    if (k == 1) {
      if (n >= s) cout << 1 << endl;
      else cout << 0 << endl;
      continue;
    }
    for (int i = 0; i < k-1; ++i) A[i] = i+1;
    A[k-1] = s - k*(k-1)/2;
    ans = 0;
    t = k-2;
    while (A[k-1] > A[k-2]) {
      if (A[k-1] <= n) ++ans;
      ++A[t];
      --A[t+1];
      if (A[t] >= A[t+1]) {
	while (t > 0) {
	  --t;
	  ++A[t];
	  u = 0;
	  for (int i = 0; i <= t; ++i) u += A[i];
	  for (int i = t+1; i < k-1; ++i) {
	    A[i] = A[i-1]+1;
	    u += A[i];
	  }
	  A[k-1] = s - u;
	  if (A[k-1] > A[k-2]) {
	    t = k-2;
	    break;
	  }
	}
	if (!t) break;
      }
    }
    cout << ans << endl;
  }
  return 0;
}