#include <iostream>

using namespace std;

int cnt = 0;

void search(int n, int k, int s) {
    if (k==0&&s==0) {
        cnt++;
        return;
    }
    if (k<=0||s<=0)
        return;
    for (int i = n; i > 0; i--)
        search(i-1, k-1, s-i);
}

int main() {
    int n, k, s;
    while (cin >> n >> k >> s, n|k|s) {
        cnt = 0;
        search(n, k, s);
        cout << cnt << endl;
    }
}