program main
    implicit none
    INTEGER :: n, a, b, x, count = 0, ans = 0, i
    READ(*, *) n, a, b
    do i = 1, n
        x = i
        do while(x > 0)
            count = count + mod(x, 10)
            x = x / 10
        enddo
        if(count >= a .and. count <= b) then
            ans = ans + i
        endif
        count = 0
    enddo
    WRITE(*, *) ans
end program main