atcoder#ARC113C. [ARC113C] String Invasion
[ARC113C] String Invasion
Score : points
Problem Statement
Given is a string of length . Let denote the -th character of . Find the maximum number of times the following operation can be done.
- Choose three consecutive characters in , , such that , and replace with .
Constraints
- consists of lowercase English letters.
Input
Input is given from Standard Input in the following format:
Output
Print the maximum number of times the operation can be done.
accept
3
We can do the operation three times, as follows:
- do it with , changing the string to
acccpt
; - do it with , changing the string to
acccct
; - do it with , changing the string to
accccc
.
atcoder
0
anerroroccurred
16