410198: GYM103973 H Substrings

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Substringstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Walk Alone has a string, and he wants you to count the number of consecutive 'fyt' in the string.

For example, the answer to 'ffyt' is $$$1$$$ since the second to the fourth character forms a consecutive 'fyt', while 'ffyytt' has no 'fyt' as its substring.

Input

The first line contains an integer $$$n\ (1 \leq n \leq 10^6)$$$, indicating the length of the string.

The second line contains a single string consisting of three characters 'f', 'y', and 't', representing the string.

Output

Output a single integer indicating the number of consecutive 'fyt' in the input string.

ExamplesInput
6
fytfyt
Output
2
Input
9
fytffyytt
Output
1

加入题单

上一题 下一题 算法标签: