#include <bits/stdc++.h>
using namespace std;

int main(void) {

    int n, k, s;
    while (cin >> n >> k >> s, n&&k&&s) {
        int ans = 0;
        for (unsigned int bit = 0; bit < (1<<n); ++bit) {
            if (__builtin_popcount(bit) != k) continue;

            int sum = 0;
            for (int i = 0; i < n; i++) {
                if (1<<i & bit) {
                    sum += (i+1);
                }
            }
            if (sum == s) ans++;
        }

        cout << ans << endl;
    }

    return 0;
}