memo = {}
def dfs(N, K, S):
    key = (N, K, S)
    if key in memo:
        return memo[key]
    if N == 0:
        return S == K == 0
    r = dfs(N-1, K, S)
    if S >= N:
        r += dfs(N-1, K-1, S-N)
    memo[key] = r
    return r

ans = []
while 1:
    N, K, S = map(int, input().split())
    if N == 0:
        break
    ans.append(dfs(N, K, S))
print(*ans, sep='\n')
