#K82602. Unique Palindromic Substrings

    ID: 36012 Type: Default 1000ms 256MiB

Unique Palindromic Substrings

Unique Palindromic Substrings

You are given a string s. Your task is to calculate the number of unique palindromic substrings in s.

A palindrome is a string that reads the same backward as forward. Formally, a string \(T\) is a palindrome if \(T = T^R\), where \(T^R\) is the reverse of \(T\).

Your solution should read the input from stdin and output the result to stdout.

inputFormat

The input contains a single line with a non-empty string s (possibly empty, in which case the answer is 0). The string contains only printable ASCII characters.

outputFormat

Output a single integer representing the number of unique palindromic substrings in s.

## sample
abaaa
5