import std.stdio;
import std.algorithm;
import std.string;
import std.range;
import std.array;
import std.conv;
import std.complex;
import std.math;
import std.ascii;
import std.bigint;
import std.container;
import std.typecons;

auto readInts() {
	return array(map!(to!int)(readln().strip().split()));
}
auto readInt() {
	return readInts()[0];
}
auto readLongs() {
	return array(map!(to!long)(readln().strip().split()));
}
auto readLong() {
	return readLongs()[0];
}

const real eps = 1e-10;

long count(int n, int k, int s, long[int[]] memo) {
	if(([n,k,s] in memo) !is null) {
		return memo[[n,k,s]];
	}
	if(n <= 0 || s <= 0) {
		return 0;
	}
	if(k == 1) {
		if(n >= s) {
			return 1;
		} else {
			return 0;
		}
	}
	long ans;
	for(int i = 1; i <= n; ++i) {
		ans += count(i-1, k-1, s-i, memo);
	}
	memo[[n, k, s].idup] = ans;
	return ans;
}

void main(){
	while(true) {
		auto nks = readInts();
		auto n = nks[0];
		auto k = nks[1];
		auto s = nks[2];
		if((n|k|s) == 0) return;
		long[int[]] memo;
		writeln(count(n, k, s, memo));
	}
}