object Main extends App {
  @scala.annotation.tailrec
  def loop(chars: Seq[Char]): Int = chars match {
    case Seq() => 0
    case _ :: _ :: xs =>
      val (l, r) = xs.splitAt(xs.length / 2)
      if (l == r) xs.length else loop(xs)
  }

  val sc = new java.util.Scanner(System.in)
  println(loop(sc.next().toCharArray.toList.reverse))
}
