program ABC066B
    implicit none
    integer(8)::i
    integer(8)::result=0
    character(200)::S
    read(5,*)S

    do i=1,len_trim(S)/2-1
        if(S(1:i)==S(i+1:2*i))then
            if(i>result)then
                result=i
            end if
        end if
    end do

    print'(i0)',2*result
end program ABC066B