program B
    implicit none
    integer::i
    character(len=200)::S
    read(*,*) S
    i = (len_trim(S)-1)/2 *2

    do while(i >= 2)
        if(S(1:i/2) .eq. S(i/2+1:i)) then
            write(*,*) i
            stop
        end if
        i = i-2
    end do
end program B