#include <iostream>
using namespace std;

int main()
{
	while (true) {
		int n, k, s;

		cin >> n >> k >> s;

		if (n == 0 && k == 0 && s == 0) {
			break;
		}

		int ans = 0;

		for (int i = 0; i < (1 << n); i++) {
			int count = 0;

			for (int j = 0; j < n; j++) {
				if ((i >> j) % 2 == 1) {
					count++;
				}
			}

			if (count == k) {
				int sum = 0;

				for (int j = 0; j < n; j++) {
					if ((i >> j) % 2 == 1) {
						sum += j + 1;
					}
				}

				if (sum == s) {
					ans++;
				}
			}
		}

		cout << ans << endl;
	}

	return 0;
}