implicit none
integer:: n,i,j,count,a,b,keta_sum, s_int,k
character(5) :: s

read(5,*) n,a,b

count=0

do i=1,n
    keta_sum=0
    write (s,"(i0)") i
    
    do j=1, len(s)
        if (s(j:j)/="") then
            read (s(j:j),*) s_int
            keta_sum=keta_sum+s_int
        endif
    enddo
    
        if (keta_sum>=a .and. b>=keta_sum) then
            count=count+i
        endif
         
enddo

write(6,*) count

end