#P3741. 小果的键盘

小果的键盘

Description

One day, she typed a string consisting of only these two characters. She especially likes a string when it contains the substring VK. Therefore, she wants to change at most one character (or do nothing) to maximize the number of occurrences of VK in the string. Given the original string, compute the maximum number of times VK can appear in the string. We consider VK to occur only when V and K are exactly adjacent.

Input Format

The first line contains an integer nn, the length of the string.

The second line contains a string ss.

Output Format

Output a single integer, the answer.

2
VK

1
2
VV
1
1
V
0
20
VKKKKKKKKKVVVVVVVVVK
3
4
KVKV

1

Hint

For 100%100\% of the testdata, 1n1001 \le n \le 100.

Translated by ChatGPT 5