solve :: String -> String
solve [s] = [s]
solve (_:ss) = if a == b
                      then ss
                      else solve ss
  where l = max 1 $ length ss `div` 2
        a = drop l ss
        b = reverse $ take l ss

main :: IO ()
main = do
  s <- reverse <$> getLine
  print . length $ solve s