#include <bits/stdc++.h>
using namespace std;
int counter(int n, int k, int s);
int main() {
  int n, k, s;
  while (1) {
    cin >> n >> k >> s;
    if (n == 0 && k == 0 && s == 0) break;
    int next_s = s - n, cnt = 0;
    cnt = counter(n, (k - 1), next_s);
    cout << cnt << endl;
  }
  return 0;
}
int counter(int n, int k, int s) {
  int ans = 0;
  if (k > 1) {
    for (int i = n - 1; i > 1; i--) {
      ans += counter(i, (k - 1), (s - i));
    }
  } else if (k == 1) {
    if (s < n && 0 < s)
      ans = 1;
    else
      ans = 0;
  }
  return ans;
}
