program main
implicit none
integer N,A,B,sum,i,k,M

read(*,*) N,A,B

sum=0
do i = A, N
	k=0
    M=i
	do while(M)
		k = k + mod(M,10)
        M = M/10
    enddo
	if(k>=A.and.k<=B)then
    	sum = sum + k
	endif
enddo

write(*,*) sum
end program