AtCoder Regular Contest 108
B
Abbreviate Fox
AtCoder
⌀ 681
原题
← AC →
翻译中…

Problem Statement

翻译中…

Given is a string $S$ of length $N$ consisting of lowercase English letters. Snuke can do this operation any number of times: remove fox occurring as a substring from $s$ and concatenate the remaining parts of $s$.

翻译中…

What is the minimum possible length of $s$ after some number of operations by Snuke?

翻译中…

Constraints

翻译中…
  • $1 \leq N \leq 2 \times 10^{5}$
  • $s$ is a string of length $N$ consisting of lowercase English letters.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N
s

翻译中…

Print

翻译中…

Print the minimum possible length of $s$ after some number of operations by Snuke.

翻译中…

样例

Input #1
6
icefox
Output #1
3
- By removing the `fox` at the end of `icefox`, we can turn $s$ into `ice`.
Input #2
7
firebox
Output #2
7
- `fox` does not occur as a substring.
Input #3
48
ffoxoxuvgjyzmehmopfohrupffoxoxfofofoxffoxoxejffo
Output #3
27
题目信息
题号
arc108_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。