import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.container;
import std.datetime;

void main()
{
	while (1) {
		auto x = readln.chomp.split.map!(to!int);
		if (!x[0]) break;
	
		bool f[21];	 
		int cnt;

		void solve(int s, int sum, int c) {
			if (c == x[1]) {
				if (sum == x[2]) cnt++;
			}
			foreach (i; s..x[0]+1) {
				if (f[i]) continue;
				f[i] = 1;
				solve(i, sum + i, c + 1);
				f[i] = 0;
			}
		}

		solve(1, 0, 0);
		cnt.writeln;
	}
}