open Batteries
open Printf
let () =
  let s = Scanf.scanf "%s " (fun a -> a) in

  let is_even str =
    let len = String.length str in
    if len mod 2 <> 0 then false else
      let fst = String.slice ~last:(len/2) str in
      let lst = String.slice ~first:(len/2) str in
      fst = lst
  in

  let rec aux str =
    let len = String.length str in
    if is_even str then len else
      aux (String.slice ~last:(len-1) str)
  in

  Printf.printf "%d\n" @@
  aux (String.slice ~last:(String.length s - 1) s)
