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.
For the first case, we do not change any letters. "VK" appears once, which is the maximum number of times it could appear.

For the second case, we can change the second character from a "V" to a "K". This will give us the string "VK". This has one occurrence of the string "VK" as a substring.

For the fourth case, we can change the fourth character from a "K" to a "V". This will give us the string "VKKVKKKKKKVVVVVVVVVK". This has three occurrences of the string "VK" as a substring. We can check no other moves can give us strictly more occurrences.
VK
1
VV
1
V
0
VKKKKKKKKKVVVVVVVVVK
3
KVKV
1
VKKVVVKVKVK
5
VKVVKVKVVKVKKKKVVVVVVVVKVKVVVVVVKKVKKVKVVKVKKVVVVKV
14
VVKKVKKVVKKVKKVKVVKKVKKVVKKVKVVKKVKKVKVVKKVVKKVKVVKKVKVVKKVVKVVKKVKKVKKVKKVKKVKVVKKVKKVKKVKKVKKVVKVK
32
KVVKKVKVKVKVKVKKVKVKVVKVKVVKVVKVKKVKVKVKVKVKVKVKVKVKVKVKVKVKVKVVKVKVVKKVKVKK
32
KVVVVVKKVKVVKVVVKVVVKKKVKKKVVKVKKKVKKKKVKVVVVVKKKVVVVKKVVVVKKKVKVVVVVVVKKVKVKKKVVKVVVKVVKK
21
VVVVVKKVKVKVKVVKVVKKVVKVKKKKKKKVKKKVVVVVVKKVVVKVKVVKVKKVVKVVVKKKKKVVVVVKVVVVKVVVKKVKKVKKKVKKVKKVVKKV
25
KKVVKVVKVVKKVVKKVKVVKKV
7
KKVVKKVVVKKVKKVKKVVVKVVVKKVKKVVVKKVVVKVVVKVVVKKVVVKKVVVKVVVKKVVVKVVKKVVVKKVVVKKVVKVVVKKVVKKVKKVVVKKV
24
KVKVKVKVKVKVKVKVKVKVVKVKVKVKVKVKVKV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VVVVVVVVVVVVVVVVVVVVVVVVVVVV
1
VVKKKKKKVKK
3
KVKVKVV
3
# from collections import defaultdict
# from sys import stdin
# import itertools
# import bisect
# from math import sqrt,ceil,floor

def func(put,mapping,unpack):
    s = list(put(str))
    ans = 0
    for i in range(-1,len(s)):
        if i > -1: s[i] = 'V' if s[i] == 'K' else 'K'
        t = 0
        for j in range(len(s)-1):
            if s[j] == 'V' and s[j+1] == 'K': t += 1
        ans = max(ans,t)
        if i > -1: s[i] = 'V' if s[i] == 'K' else 'K'
    print(ans)
    
def init(TestCases=True):
    put = lambda s: s(input().strip())
    mapping = lambda s: list(map(s,input().split()))
    unpack = lambda s: map(s,input().split())
    for _ in range(int(input()) if TestCases else 1):
        func(put,mapping,unpack)

if __name__ == '__main__':
    init(False)