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.


-----Input-----

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-----

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.


-----Examples-----
Input
VK

Output
1

Input
VV

Output
1

Input
V

Output
0

Input
VKKKKKKKKKVVVVVVVVVK

Output
3

Input
KVKV

Output
1



-----Note-----

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.

Difficulty: interview

Starter code:

Solutions:
s = input()
d = dict()
d['V'] = 'K'
d['K'] = 'V'
m = s.count('VK')
s = list(s)
for i in range(len(s)):
    s[i] = d[s[i]]
    m = max(m,''.join(s).count('VK'))
    s[i] = d[s[i]]
print(m)

def alternate(c):
    if c == "V":
        return "K"
    return "V"

s = input()
res = s.count("VK")
for i in range(len(s)):
    res = max(res, (s[:i]+alternate(s[i])+s[i+1:]).count("VK"))
print(res)

import re
def count(s):
    return len(re.findall(r'VK', s))

s = input().strip()
best = count(s)
for i in range(len(s)):
    cur_s = s[:i] + 'V' + s[i + 1:]
    best = max(best, count(cur_s))
    cur_s = s[:i] + 'K' + s[i + 1:]
    best = max(best, count(cur_s))
print(best)


s=str(input())
m=s.count('VK')
for i in range(len(s)):
    if s[i]=='V':
        t='K'
    else:
        t='V'
    temp=s[:i]+t+s[i+1:]
    #print(temp)
    if temp.count('VK')>m:
        m=temp.count('VK')
print(m)


'''input
KKKKKKV
'''
s = input().replace("VK", ".")
if "VV" in s or "KK" in s:
	print(s.count(".") + 1)
else:
	print(s.count("."))

#!/usr/bin/env python3
import re


def solve():
    s = input()
    m = 0
    for i in range(len(s)):
        m = max(m, len(re.findall("VK", s[:i]+"V"+s[i+1:])))
        m = max(m, len(re.findall("VK", s[:i]+"K"+s[i+1:])))
    print(m)


def __starting_point():
    solve()

__starting_point()

def get(s):
    res = 0
    for i in range(len(s) - 1):
        if s[i] == 'V' and s[i + 1] == 'K':
            res += 1
            
    return res


s = input()
l = list(s)

ans = 0
for i in range(len(l)):
    st = l[i]
    
    l[i] = 'V'
    ans = max(ans, get(''.join(l)))
    
    l[i] = 'K'
    ans = max(ans, get(''.join(l)))
    
    l[i] = st
    
print(ans)

s = input()
maxx = 0
for i in range(len(s)):
    news = s[:i] + 'V' + s[i+1:]
    maxx = max(news.count('VK'), maxx)
    news = s[:i] + 'K' + s[i + 1:]
    maxx = max(news.count('VK'), maxx)
print(maxx)


s=input()
if len(s)==1:
    print(0)
else:
    x=s.count('VK')
    for i in range(len(s)):
        if s[i]=='K':
            if i<len(s)-1 and s[i+1]=='K' and (i==0 or s[i-1]=='K'):
                x+=1
                break
        elif i>0 and s[i-1]=='V' and (i==len(s)-1 or s[i+1]=='V'):
            x+=1
            break
    print(x)


s = input().strip()
s = s.replace("VK", "*")
cnt = sum(map(lambda x: x=="*",s))
if "VV" in s or "KK" in s:
  cnt +=1
print(cnt)  

s=input()
m=s.count('VK')
for i in range(len(s)):
    s2=s[:i]+'V'+s[i+1:]
    s3=s[:i]+'K'+s[i+1:]
    m=max(m,s2.count('VK'))
    m=max(m,s3.count('VK'))
    #print(s2,s3)
print(m)

l=input()
s=[]
for i in l:
	if(i=='V'):
		s.append(1)
	else:
		s.append(0)
ls=len(s)
i=0
maxc = 0
c = 0
while i+1<ls:
	if(s[i]==1 and s[i+1]==0):
		c+=1
	i+=1
maxc = max(maxc,c)
j=0
while j<ls:
	if(s[j]==1):
		s[j]=0
	else:
		s[j]=1
	i=0
	c=0
	while i+1<ls:
		if(s[i]==1 and s[i+1]==0):
			c+=1
		i+=1
	maxc=max(c,maxc)
	if(s[j]==1):
		s[j]=0
	else:
		s[j]=1
	j+=1
print(maxc)

import sys

def solve():
    s = [ch for ch in input()]
    ans = ''.join(s).count('VK')

    for i in range(len(s)):
        if s[i] == 'V':
            s[i] = 'K'

            tmp = ''.join(s).count('VK')
            ans = max(ans, tmp)

            s[i] = 'V'
        else:
            s[i] = 'V'

            tmp = ''.join(s).count('VK')
            ans = max(ans, tmp)

            s[i] = 'K'

    print(ans)

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def __starting_point():
    solve()
__starting_point()

def main():
    s = input()
    c = s.count('VK')
    if s.find('VVV') >= 0 or s.find('KKK') >= 0 or s[:2] == 'KK' or s[-2:] == 'VV':
        c += 1
    print(c)
main()

s=input()
a=s.count("VK")
s=s.replace("VK"," ")
a+=1 if "VV" in s or "KK" in s else 0
print(a)


x=input()
t=x.count("VK")
l=x.replace("VK"," ")
if "KK" in l:
    t+=1
    print(t)
elif "VV" in l:
    t+=1
    print(t)
else:
    print(t)

from sys import stdin, stdout

a = stdin.readline().rstrip()
a=list(a)

vkCount=0
change=False
if a[0:2]==list('KK'):
    change=True
    a[0]='V'
elif a[-2:]==list('VV'):
    change=True
    a[-1]='K'

i=0
while i<len(a)-2 and not change:
    if a[i:i+3]==list('VVV'):
        a[i+1]='K'
        change=True
    elif a[i:i+3]==list('KKK'):
        a[i+1]='V'
        change=True
    i+=1
        
for i in range(len(a)-1):
    if a[i:i+2]==list('VK'):
        vkCount+=1

print(vkCount)


import sys

def main():
    s=sys.stdin.readline().rstrip()
    result=0
    
    for i in range(len(s)-1):
        if s[i:i+2]=='VK': result+=1
    
    if s.startswith('KK') or s.endswith('VV') or 'VKKK' in s or 'VVV' in s: result+=1
    
    sys.stdout.write(str(result)+'\n')
    
main()



s = input()
k = 0
for i in range(len(s) - 1):
    if s[i] == 'V' and s[i + 1] == 'K':
        k += 1
for i in range(len(s)):
    if i < len(s) - 1:
        if s[i] == 'V' and s[i + 1] == 'V' and i + 2 == len(s):
            k += 1
            break
        if s[i] == 'V' and s[i + 1] == 'V' and s[i + 2] == 'V':
            k += 1
            break
    if i >= 1:
        if i == 1 and s[1] == 'K' and s[0] == 'K':
            k += 1
            break
        if s[i] == 'K' and s[i- 1] == 'K' and s[i - 2] == 'K':
            k += 1
            break
print(k)

s=list(input())
ans=0
n=len(s)
for i in range(n-1):
    if s[i]=='V' and s[i+1]=='K': ans+=1
for t in range(len(s)):
    anst=0
    ss=s[:]
    if ss[t]=='V': ss[t]='K'
    else: ss[t]='V'
    for i in range(n-1):
        if ss[i]=='V' and ss[i+1]=='K': anst+=1
    if anst>ans: ans=anst
print(ans)

import sys
import math
s = input()
cnt = s.count("VK");
if s[:2] == "KK":
    cnt += 1
elif s[-2:] == 'VV':
    cnt += 1
elif s.find("VVV") >= 0:
    cnt += 1
elif s.find("KKK") >= 0:
    cnt += 1
print(cnt)

#l=[int(i)for i in input().split()]
s=input()
i=0
a=s.find("VK")
ans=0
while a!=-1:
	ans+=1
	s=s[:a]+"."+s[a+2:]
	a=s.find("VK")
if s.count("VV")>0 or s.count("KK")>0:ans+=1
print(ans) 

def f(S):
    ans = 0
    for i in range(1, len(S)):
        if S[i - 1] == "V" and S[i] == "K":
            ans += 1
    return ans

S = list(input())
ans = f(S)
D = {"V" : "K", "K" : "V"}
for i in range(len(S)):
    S[i] = D[S[i]]
    ans = max(ans, f(S))
    S[i] = D[S[i]]
print(ans)

#!/usr/bin/env python3
from sys import stdin,stdout


def ri():
    return list(map(int, input().split()))


s = input()
l = len(s)
v = [0 for i in range(l)]

if l == 1:
    print(0)
    return


count = 0
for i in range(l-1):
    if v[i]:
        continue
    if s[i:i+2] == "VK":
        v[i] = 1
        v[i+1] = 1
        count += 1

for i in range(l-1):
    if v[i] or v[i+1]:
        continue

    if s[i:i+2] == "VV" or s[i:i+2] == "KK":
        count += 1
        break

print(count)



s=list(' '+input())
m=0
for i in range(len(s)):
    ss=[]
    for i0 in range(len(s)):
        ss.append(s[i0])
    if ss[i]=='V':
        ss[i]='K'
    elif ss[i]=='K':
        ss[i]='V'
    mm=0
    for i0 in range(len(s)-1):
        if ss[i0]=='V'and ss[i0+1]=='K':
            mm=mm+1
    if mm>m:
        m=mm
print(m)