Disha has a string $S$
. In one second, Disha can choose a subsequence from $S$
that make the word “code” and remove it from the string. The process will be continued until she can't choose a subsequence that make the word.
In this problem, Good letter means [c,d,e,o]. And others letters are Bad.
Now, you have to find the maximum number of seconds Disha will work.
The first line of the input contains a single integer $n$
- the length of the string $s$
.
Next line contains string $s$
. the string consists of only lowercase English letters.
$1 \le n \le 5000$
$1 \le n \le 500000$
Number of good letters $\leq 5000$
$1 \le n \le 500000$
Output the maximum number of seconds Disha will work.
Input | Output |
---|---|
8 codceode | 2 |