implicit none
integer :: i,a,b,ans=0
character(5) :: charI

read*,a,b

do i = a,b
  write(i,'(I0)') charI
  if( charI(1:1)==charI(5:5) .and. charI(2:2)==charI(4:4) )then
    ans = ans + 1
  end if
end do
end