#include <iostream>
using namespace std;

int main()
{
	int n, k, s, res;
	while (cin >> n >> k >> s, n || k || s) {
		res = 0;
		for (int i = 0; i < (1 << n); i++) {
			int dec = 0;
			for (int j = 1; j <= i; j <<= 1) {
				if (j & i)
					dec++;
			}
			int da = 0;
			if (dec == k) {
				for (int j = 0; 1 << j <= i; j++)
					if ((1 << j) & i)
						da += j + 1;
				if (da == s)
					res++;
			}
		}
		cout << res << endl;
	}
	return 0;
}