#include "bits/stdc++.h"
#define pb push_back
#define mt make_tuple
#define all(a) (a).begin(),(a).end()
#define frep(i,a,n) for(int i=(a);i<(n);++i)
#define rep(i, n) for(int i=0;i<(n);++i)
#define rrep(i, n) for(int i=n-1;i>=0;--i)
#define debug(x) cout << #x << " : " << x << " ------------ " << endl;
using namespace std;
int N, K, S;
int calc(int n, int k, int s, int count) {
    if (s == S && k == K) {
        return ++count;
    }
    if (n > N || s > S) {
        return count;
    }
    
    count = calc(n + 1, k + 1, s + n, count);
    
    return calc(n + 1, k, s, count);
}
int main()
{
    while (cin >> N >> K >> S, N | K | S) {
        cout << calc(1, 0, 0, 0) << endl;
    }
    return EXIT_SUCCESS;
}