433. Adarsh's Palindromic Substring

0

Medium

Uttam has recently learned about palindromes. Adarsh has given him a task to determine the total number of substrings in a given string s that are palindromes. Help Uttam find the total number of palindromic substrings. Note: A substring is a contiguous sequence of characters within the string.

Input Format

The input consists of only one line, which takes a string as input.

Output Format

Print the total number of palindromic substrings in the input string.

Example

Input

abcba

Output

7

Constraints

1 <= s.length <= 1000
s consists of lowercase English letters.
Loading...

View Submissions

Console