let S = stdin.ReadLine()

let N = S.Length;
let even n =
  match n with
    |  n when (n % 2) <> 0 -> false;
    |  _ ->
         seq{ for i in 0..(n/2 - 1) do
                yield S.[i] = S.[i + n/2] }
         |> Seq.reduce (&&)

let rec f n = 
  match n with
    | 0 -> 0
    | n when not (even n) -> f (n - 1)
    | _ -> n


f (N - 1)
|> printfn "%d"

