P25074 [AtCoder] Abbreviate Fox
普及-
题目描述

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?

Input

Input is given from Standard Input in the following format:
N
s

Sample Output 1

3

  • By removing the fox at the end of icefox, we can turn s into ice.

Constraints

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

Sample Input 1

6
icefox

Sample Output 1

3

  • By removing the fox at the end of icefox, we can turn s into ice.

Sample Input 2

7
firebox

Sample Output 2

7

  • fox does not occur as a substring.

Sample Input 3

48
ffoxoxuvgjyzmehmopfohrupffoxoxfofofoxffoxoxejffo

Sample Output 3

27

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
6 icefox
样例输出
3