#K2121. Maximum Palindromic Substrings

    ID: 24667 Type: Default 1000ms 256MiB

Maximum Palindromic Substrings

Maximum Palindromic Substrings

Given a string s of length n consisting of lowercase English letters, determine the maximum possible number of palindromic substrings in s. A substring is considered palindromic if it reads the same forwards and backwards. Note that every individual character is a palindrome. Therefore, the answer is simply n, the length of the string.

The input will be provided via standard input and the output should be written to standard output.

inputFormat

Input consists of two lines. The first line contains an integer n, which is the length of the string. The second line contains the string s.

outputFormat

Output a single integer representing the maximum number of palindromic substrings in s.## sample

6
abccba
6