#include <iostream>
using namespace std;

int cnt;

void countSet(int n, int k, int s) {
    if (k == 1 && s == n) {
        cnt++;
    } else if (s > n) {
        for (int i = n - 1; i > 0; --i) {
            countSet(i, k - 1, s - n);
        }
    }
}

int main()
{
    int n, k, s;
    while (cin >> n >> k >> s, n) {
        cnt = 0;
        if (k == 1 && s <= n) {
            cnt = 1;
        } else {
            for (int i = n; i * k > s; --i) {
                countSet(i, k, s);
            }
        }
        cout << cnt << endl;
    }
    return 0;
}