import Data.List import Data.Ord main = getLine >>= print . lpalin lpalin = length . head . filter isPalin . tail . sortBy (flip (comparing length)) . partitions where isPalin s = s == reverse s partitions = concatMap tails . inits