program B083
    implicit none
    integer(8) :: N, A, B
    integer(8) :: i, j, k, l, sum

    read(5,*) N, A, B
    sum = 0
    do i = 1, N
        k = i
        l = 0
        do j = 1, 5
            l = l + mod(k,10**j) / 10**(j-1)
        end do
        if (A<=l .and. l<=B) then
            sum = sum + i
        end if
    end do

    write(6,*) sum



end program B083