program test
	implicit none
    integer::a,b,N,ans,i,x,y
    read*,N,a,b
    ans=0
    do i=1,N
    	x=i
        y=0
    	do while(x>0)
        	y=mod(x,10)+y
        	x=x/10
        end do
        if(y>=a .and. b>=y)then
        	ans=ans+i
        end if
    end do
    print*,ans
end program test