题库练习 Vicious Keyboard
← 上一题 下一题 →

A10897 | Vicious Keyboard

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Tonio has a keyboard with only two letters, "V" and "K".

One day, he has typed out a string $s$ with only these two letters. He really likes it when the string "VK" appears, so he wishes to change at most one letter in the string (or do no changes) to maximize the number of occurrences of that string. Compute the maximum number of times "VK" can appear as a substring (i. e. a letter "K" right after a letter "V") in the resulting string.

输入格式

The first line will contain a string $s$ consisting only of uppercase English letters "V" and "K" with length not less than $1$ and not greater than $100$ .

输出格式

Output a single integer, the maximum number of times "VK" can appear as a substring of the given string after changing at most one character.

输入输出样例

输入 #1
VK
输出 #1
1
输入 #2
VV
输出 #2
1
输入 #3
V
输出 #3
0
输入 #4
VKKKKKKKKKVVVVVVVVVK
输出 #4
3
输入 #5
KVKV
输出 #5
1
C++ 编辑器
输入
输出