#include <bits/stdc++.h>
using namespace std;

int solve(int n, int k, int s) {
    function<int(int, int, int)> dfs = [&](int i, int p, int t) {
        if (i == k) return int(t == 0);
        int cnt = 0;
        for (int e = p + 1, u = min(n, t); e <= u; ++e) cnt += dfs(i + 1, e, t - e);
        return cnt;
    };
    return dfs(0, 0, s);
}

int main() {
    for (int n, k, s; cin >> n >> k >> s, n | k | s;) cout << solve(n, k, s) << endl;
}