#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, k, s;
    
    while (scanf("%d %d %d", &n, &k, &s) && n){
        int a = 0;
        
        for (int i = 0; i < 1 << n; i++){
            if (__builtin_popcount(i) != k) continue;
            int tmp = 0;
            for (int j = 0; j < n; j++){
                if (i >> j & 1) tmp += j + 1;
            }
            if (tmp == s) a++;
        }
        printf("%d\n", a);
    }
    
    return (0);
}