#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<functional>
#include<map>
using namespace std;

int main() {
	int a, b, c;
	while (cin >> a >> b >> c, a || b || c) {
		int s = 0;
		for (int d = 1; d < (1 << a); d++) {
			int g = 0, h = 0;
			for (int e = 1, f = 1; e <= a; e++, f <<= 1) {
				if (d&f) {
					g++;
					h += e;
				}
			}
			if (g == b&&c == h)s++;
		}
		cout <<s<< endl;
	}
}