Module Module1

sub Main(ByVal args() as String)
    dim arr() as string = Split(Console.ReadLine())
    dim N as integer = arr(0)
    dim A as integer = arr(1)
    dim B as integer = arr(2)

    dim cnt as integer = 0
    for i as integer = 1 to N
        dim c as integer = i
        dim sum as integer = 0
        do until c = 0
            sum += c mod 10
            c = int(c/10)
        loop
        if A <= sum andalso sum <= B then
            cnt += i
        end if
    next i

    Console.WriteLine(cnt)
end sub

end Module