implicit none
integer :: a,b
integer :: n,i,j,k,nstr
character(5) :: str
logical :: flg

read *,a,b

n = 0
do i = a, b
   write(str,'(i0)') i
   flg = .true.
   nstr = len_trim(str)
   k = nstr+1
   do j = 1, nstr/2
      k = k - 1
      if (str(j:j) .ne. str(k:k)) then
         flg = .false.
         exit
      endif
   enddo
   if (flg) then
      n = n + 1
   endif
enddo

write(6,'(i0)') n
stop
end