program name
    implicit none
    integer(4):: n,i,ans
    character(200):: s

    read*, s(:)
    n = len_trim(s)
    ans = 0
    do i=1,n/2-1
        if (s(1:i) == s(i+1:2*i)) ans=max(ans,i)
    end do
    print*, ans*2
end program name