import itertools
while True:
    N,K,S = map(int,input().split())
    if N == 0: break
    cnt = 0
    for comb in itertools.combinations(range(1,N+1),K):
        if sum(comb) == S:
            cnt += 1
    print(cnt)