#include <cstdio>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
using namespace std;

int main() {
    while (true) {
        int n, k, s; scanf("%d%d%d", &n, &k, &s);
        if (n == 0 and k == 0 and s == 0) break;
        int result = 0;
        repeat (x, 1 << n) if (__builtin_popcount(x) == k) {
            int acc = 0;
            repeat (i, n) if (x & (1 << i)) {
                acc += i + 1;
            }
            result += (acc == s);
        }
        printf("%d\n", result);
    }
    return 0;
}