#K78087. Longest Palindromic Substring Length Finder

    ID: 35008 Type: Default 1000ms 256MiB

Longest Palindromic Substring Length Finder

Longest Palindromic Substring Length Finder

Given a string ( s ), your task is to determine the length of its longest palindromic substring. A palindromic substring is a contiguous subsequence that reads the same from left to right and from right to left.

For example, if ( s = \text{'babad'} ), one of the longest palindromic substrings is ( \text{'bab'} ) (or ( \text{'aba'} )), both of length 3.

Your program should read the input from standard input and output the length of the longest palindromic substring to standard output.

inputFormat

The input consists of a single line containing the string ( s ). The string may consist of both uppercase and lowercase letters and its length is at most 1000.

outputFormat

Output a single integer representing the length of the longest palindromic substring of ( s ).## sample

babad
3