#arc113c. [arc113_c]String Invasion
[arc113_c]String Invasion
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.
Sample Input 1
accept
Sample Output 1
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
.
Sample Input 2
atcoder
Sample Output 2
0
Sample Input 3
anerroroccurred
Sample Output 3
16