#include <iostream>
using namespace std;

int N, K, S;

int dfs(int i, int k, int sum) {
    if(i > N && k < K) {
        return 0;
    }
    if(k == K) {
        return S == sum;
    }
    return dfs(i+1, k, sum) + dfs(i+1, k+1, sum+i);
}

int main() {
    while(cin >> N >> K >> S, N) {
        cout << dfs(1, 0, 0) << endl;
    }
}
