#include <iostream>

#define N 20
#define K 10
#define S 155

using namespace std;

int count_sets(int n, int k, int s) {
    int count = 0;
    if (k == 0) {
        if (s == 0) {
            return 1;
        }
        return 0;
    }
    for (int i=1; i<=n; i++) {
        count += count_sets(i-1, k-1, s-i);
    }
    return count;
}

int main() {
    while (true) {
        int n, k, s;
        cin >> n >> k >> s;
        if (n == 0) {
            return 0;
        }
        cout << count_sets(n, k, s) << endl;
    }
}