#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <bitset>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
typedef long long ll;

int n,k,s;

int main()
{
    while(cin >> n >> k >> s) {
        if(n == 0 || k == 0 || s == 0) break;
        
        int ans = 0;
        rep(i,1<<n) {
            bitset<20> bit(i);
            if(bit.count() == k) {
                int sum = 0;
                rep(i,20) {
                    if(bit[i]) {
                        sum += i+1;
                    } 
                }

                if(sum == s) {
                    ans++;
                }
            }
        }
        cout << ans << endl;
    }

    return 0;
}