#include <bits/stdc++.h>

using namespace std;

int n, k, s;
int ret;

void f(int m, int num, int sum){
    if(num == k && sum == s)ret++;
    else if(s <= sum || k <= num) return;
    else {
        for(int i=m; i <= n; i++){
            f(i+1, num+1, sum+i);
        }
    }
}

int main(){
    while(cin >> n >> k >> s, n+k+s){
        ret = 0;
        for(int i=1; i <= n; i++){
            f(i+1, 1, i);
        }
        cout << ret << endl;
    }
}