#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
int cnt;
int n, k, s;
void dfs(int add, int sum, int re) {
  if (k == re) {
    if (sum == s) cnt++;
    return;
  }
  for (int i = add + 1; i < s - add * (k - re) && i <= n; i++) {
    dfs(i, sum + i, re + 1);
  }
}
int main() {
  while (cin >> n >> k >> s, n) {
    cnt = 0;
    dfs(0, 0, 0);
    cout << cnt << endl;
  }
}
