open System open System.Text let solve s = let len = s |> String.length let lengest_palin k = let rec loop i j l = if 0 <= i && i < len && 0 <= j && j < len && s.[i] = s.[j] then loop (i - 1) (j + 1) (l + 2) else l [ loop (k - 1) (k + 1) 1; loop k (k + 1) 0 ] [ for k in 0..((s |> String.length) - 1) do yield! lengest_palin k ] |> List.filter ((<>) len) |> List.fold max 1 [] let main argv = let s = Console.ReadLine() printfn "%d" <| solve s //exit 0