import std.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;

void main() {
    int n, k, s;
    while (readf("%d %d %d\n", &n, &k, &s), n || k || s) {
        int dfs(int m, int r, int sum) {
            if (r == 0) {
                return sum == 0;
            }
            if (m == n) return 0;
            int ans = 0;
            for (int i = m + 1; i <= n; i++) {
                ans += dfs(i, r - 1, sum - i);
            }
            return ans;
        }
        dfs(0, k, s).writeln;
    }
}