program ABC_083_B_SomeSums
   implicit none
   integer N, A, B, v, Sumrank, co, i, j, k, l, m
   read(*, *) N, A, B
   co = 0
   do m = 0, 1
       do l = 0, 9
           do k = 0,9
               do j = 0, 9
                   do i = 0, 9
                      v = i + 10*j + 100*k + 1000*l + 10000*m
				      Sumrank = i + j + k + l + m
	                  if( v > N ) then
	                      goto 1
	                  else if( (A <= Sumrank) .and. (Sumrank <= B) ) then
                          co = co + v
                      end if
                   end do
		       end do
	       end do
       end do
   end do
   1 continue
   write(*, *) co
end  program ABC_083_B_SomeSums