program sample
    implicit none
    character(200)::s
    integer(8) :: i,j,m,n
    integer(8),allocatable :: x(:),y(:)
  
    read(*,*) s
    n=len_trim(s)
    m=1
    if (mod(n,2)==1)then
        s=s(1:n-1)
        n=n-1
        m=0
    end if

    do i=m,n/2
        if (s(1:n/2-i) .eq. s(n/2+1-i:n-2*i))then
            write(*,*) n-2*i
            stop
        end if
    end do
    stop
end program sample
  

