import scala.io.StdIn

object Main extends App {

  val q = StdIn.readLine()
  
  def solve(s: String): Int = {
    val (s1, s2) = s.splitAt(s.length/2)
    if(s1 == s2) s.length
    else solve(s.tail)
  } 
  
  println(solve(q.reverse.tail))
  
}
