def dfs(i,k,s):

    if k == s == 0: return 1

    if i > n or s < i*k+k-1: return 0

    return dfs(i+1,k,s)+dfs(i+1,k-1,s-i)

 

while 1:

    n,k,s = list(map(int,input().split()))

    if n == 0: break

    print(dfs(1,k,s))
import itertools

while 1:

    n,k,s = list(map(int,input().split()))

    if n == 0: break

    print(sum(sum(ele) == s for ele in itertools.combinations(list(range(1,n+1)),k)))
def dfs(i, k, s):
    if k == s == 0:
        return 1
    if i > n or s < i * k + k - 1:
        return 0
    return dfs(i + 1, k, s) + dfs(i + 1, k - 1, s - i)


while 1:
    n, k, s = list(map(int, input().split()))
    if n == 0:
        break
    print(dfs(1, k, s))

import itertools

while 1:
    n, k, s = list(map(int, input().split()))
    if n == 0:
        break
    print(
        sum(sum(ele) == s for ele in itertools.combinations(list(range(1, n + 1)), k))
    )

-def dfs(i, k, s): -    if k == s == 0: -        return 1 -    if i > n or s < i * k + k - 1: -        return 0 -    return dfs(i + 1, k, s) + dfs(i + 1, k - 1, s - i) - +import itertools -    print(dfs(1, k, s)) +    print( +        sum(sum(ele) == s for ele in itertools.combinations(list(range(1, n + 1)), k)) +    )