atcoder#AGC037A. [AGC037A] Dividing a String
[AGC037A] Dividing a String
Score : points
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.
aabbaa
4
We can, for example, divide into four strings aa
, b
, ba
, and a
.
aaaccacabaababc
12