module Main where

import Control.Applicative
import Control.Monad
import Data.List
import Data.Char (isAlpha)
import qualified Data.ByteString.Char8 as B

f :: B.ByteString -> Bool
f xs = let (as, bs) = B.splitAt (B.length xs `div` 2) xs in as == bs

main :: IO ()
main = do
    ss <- B.takeWhile isAlpha <$> B.getLine
    let xss = tail . reverse $ B.inits ss
    let Just ans = find f xss
    print $ B.length ans