(* O(n^2) *)
let s = read_line ()
let n = String.length s
let i = ref 2
let is_even s = let m = String.length s in String.sub s 0 @@ m / 2 = String.sub s (m / 2) @@ m / 2
let _ =
  while !i < n do
    if is_even @@ String.sub s 0 @@ n - !i then (Printf.printf "%d\n" @@ n - !i; exit 0);
    i := !i + 2
  done