#agc037a. [agc037_a]Dividing a String
[agc037_a]Dividing a String
Problem Statement
Given is a string consisting of lowercase English letters. Find the maximum positive integer that satisfies the following condition:
- There exists a partition of into non-empty strings such that ().
Here represents the concatenation of in this order.
Constraints
- consists of lowercase English letters.
Input
Input is given from Standard Input in the following format:
Output
Print the maximum positive integer that satisfies the condition.
Sample Input 1
aabbaa
Sample Output 1
4
We can, for example, divide into four strings aa
, b
, ba
, and a
.
Sample Input 2
aaaccacabaababc
Sample Output 2
12