def dfs(v,c,m,n,k,s)
    if c == k
        return 1 if m == s
        return 0 if m != s
    end
    return 0 if v > n || m > s
    ans = 0
    (v+1).upto(n) do |i|
        ans += dfs(i,c+1,m+i,n,k,s)
    end
    return ans
end
loop do
    n, k, s = gets.split.map(&:to_i)
    break if n == 0 && k == 0 && s == 0
    puts dfs(0,0,0,n,k,s)
end