let solve s n =
  let rec doit n =
    if n = 0 then assert false
    else
      let m = n / 2 in
      let rec aux i =
        if i = m then true
        else s.[i] = s.[m+i] && aux (i + 1) in
      if aux 0 then n
      else doit (n - 2) in
  doit n

let () =
  let s = read_line () in
  let n = String.length s in
  solve s (if n mod 2 = 0 then n - 2 else n - 1) |> Printf.printf "%d\n"