program tenquestionfive
 implicit none
 integer N, A, B, i, sum, res
 integer x1, x2, x3, x4, x5
 read(*,*) N, A, B
 res=0
 do i=1,N
 x1=int(i/10**4)
 x2=int(i/10**3)-x1*10**1
 x3=int(i/10**2)-x1*10**2-x2*10**1
 x4=int(i/10**1)-x1*10**3-x2*10**2-x3*10**1
 x5=int(i/10**0)-x1*10**4-x2*10**3-x3*10**2-x4*10**1
 sum=x1+x2+x3+x4+x5
 if ((sum.ge.A).and.(sum.le.B)) res=res+i
 end do
 write(*,*) res
end program