atcoder#ABC237H. [ABC237Ex] Hakata
[ABC237Ex] Hakata
Score : points
Problem Statement
We have a string consisting of lowercase English letters. Bob just thinks about palindromes every day. He decided to choose some of the substrings of that are palindromes and tell them to Anna.
Anna gets angry if one of the palindromes told by Bob is a substring of another.
How many palindromes can Bob choose while not making Anna angry?
Notes
A substring of is the result of deleting zero or more characters from the beginning and the end of .
For example, ab
is a substring of abc
, while ac
is not a substring of abc
.
Constraints
- consists of lowercase English letters.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
ababb
3
Three palindromes aba
, bab
, bb
can be chosen.
xyz
3
Three palindromes x
, y
, z
can be chosen.
xxxxxxxxxx
1