(* O(n^2) *)
open String
let s = read_line ()
let n = length s
let rec find i =
  let m = n - i in
  if sub s 0 @@ m / 2 = sub s (m / 2) @@ m / 2 then m
  else find @@ i + 2
let _ = Printf.printf "%d\n" @@ find 2