object Main extends App{
    val s = scala.io.StdIn.readLine
    val output = (2 until s.length by 2).map(s.take(_)).filter(e => e.take(e.length/2) == e.takeRight(e.length/2)).map(_.length).max
    println(output)
}
