atcoder#ARC108B. [ARC108B] Abbreviate Fox

[ARC108B] Abbreviate Fox

Score : 400400 points

Problem Statement

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

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

Constraints

  • 1N2×1051 \leq N \leq 2 \times 10^{5}
  • ss is a string of length NN consisting of lowercase English letters.

Input

Input is given from Standard Input in the following format:

NN

ss

Print

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

6
icefox
3
  • By removing the fox at the end of icefox, we can turn ss into ice.
7
firebox
7
  • fox does not occur as a substring.
48
ffoxoxuvgjyzmehmopfohrupffoxoxfofofoxffoxoxejffo
27