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 (guu(i)) ans=max(ans,i)
    end do

    print*, ans*2

contains
function guu(num) result(ret)
    integer(4):: num
    logical:: ret

    ret = s(1:num) == s(num+1:2*num)
end function
end program name