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
__author__ = 'zihaozhu'
from sys import stdin
from collections import deque
from collections import defaultdict
import re

import math
st = stdin.readline().rstrip()

if st=="VK":
    print(1)
elif len(st)<2:
    print(0)
else:
    count = 0
    c = 0
    uses = 1
    while c < len(st)-1:
        if st[c] == 'V' and st[c+1]=='K':
            count +=1
            c+=2
        elif st[c] == 'V' and st[c+1]!='V' and uses!=0:
            count += 1
            c+=2
            uses-=1
        elif st[c]=='K' and st[c+1]=='K' and uses != 0:
            uses-=1
            count+=1
            c+=2
        else:
            c+=1
    print(count)


#
# n=int(stdin.readline())
# #5*9^(n-1)*(10^n-1)
# mod = 1000000007
#
# #print((5*(9**((n-1)%mod)%mod)*((((10**n) % mod)-1)%mod))%mod)
#
# print(((5*pow(9,n-1,mod)*(pow(10,n,mod)-1)%mod))%mod)

#
# def subset(chem,n):
#     sumx = sum(chem)
#     dp  = [ [0 for _ in range(sumx+1)] for _ in range(n+1)]
#
#     for i in range(n+1):
#         dp[i][0] = True
#
#
#     for i in range(1,sumx+1):
#         dp[0][i] = False
#
#     for i in range(1,n+1):
#         for k in range(1,sumx+1):
#             dp[i][k] = dp[i-1][k]
#
#             if chem[i-1] <= k:
#                 dp[i][k] |= dp[i-1][k-chem[i-1]]
#
#
#     diff = float('inf')
#
#     k = sumx//2
#     while k>=0:
#         if dp[n][k] == True:
#             diff = sumx-2*k
#             k-=1
#             break
#
#         k-=1
#
#     #print(diff)
#     return diff
#
#
# def win():
#     print("BALANCED")
# def lose():
#     print("UNBALANCED")
#
# cases = int(stdin.readline())
#
# for case in range(cases):
#     numInt = int(stdin.readline())
#     chemicals = list(map(int,stdin.readline().split()))
#     numInt2 = int(stdin.readline())
#     chemicals2 = list(map(int,stdin.readline().split()))
#     origDiff = abs(sum(chemicals)-sum(chemicals2))
#     chemicals += chemicals2
#    # print(chemicals)
#    # print(origDiff)
#     chemicals.sort()
#     x = subset(chemicals,len(chemicals))
#     # print(numInt,chemicals,numInt2,chemicals2)
#     if x == origDiff :
#         win()
#     else:
#         lose()
#


#
# def odd(x):
#     if x%2==1:
#         return (int(math.floor(x/2)), int(math.ceil(x/2)))
#     else:
#         return (int(x/2),int(x/2))
#
# N,M,K = map(int,stdin.readline().split())
# grid = []
# for cases in range(N):
#     grid.append(list(stdin.readline().strip()))
#
#
# if len(grid)==0 or K ==0:
#     print(0)
#     exit()
#
#
# if(grid[0][0]=='#'):
#     print(0)
#     exit()
# grid[0][0] = K
#
#
# for x in range(N):
#     for y in range(M):
#         #move right
#
#         if(grid[x][y]=='#' or grid[x][y]=='.'):
#             continue
#
#         if y+1<M and x+1<N:
#             if grid[x][y+1] != '#' and grid[x+1][y] !='#' and grid[x][y]!='#':
#                 if(grid[x][y+1] == '.'):
#                     grid[x][y+1] = odd(int(grid[x][y]))[0]
#                 else:
#                     grid[x][y+1] += odd(int(grid[x][y]))[0]
#                 if(grid[x+1][y]=='.'):
#                     grid[x+1][y] = odd(int(grid[x][y]))[1]
#                 else:
#                     grid[x+1][y] += odd(int(grid[x][y]))[1]
#
#             elif grid[x][y+1] != '#' and grid[x][y]!='#':
#
#                 if(grid[x][y+1] == '.'):
#                     grid[x][y+1] =  int(grid[x][y])
#                 else:
#                     grid[x][y+1] += int(grid[x][y])
#
#             elif grid[x+1][y]!='#':
#                 if(grid[x+1][y]=='.'):
#                     grid[x+1][y] = int(grid[x][y])
#                 else:
#                     grid[x+1][y] += int(grid[x][y])
#             #else:
#                 #print("Error in first condition")
#
#         elif x+1<N:
#             if (grid[x+1][y] != '#') and grid[x][y]!='#':
#                 if(grid[x+1][y]=='.'):
#                     grid[x+1][y] = int(grid[x][y])
#                 else:
#                     grid[x+1][y] += int(grid[x][y])
#
#         elif y+1<M:
#             if (grid[x][y+1] !='#') and grid[x][y]!='#':
#                 if(grid[x][y+1]=='.'):
#                     grid[x][y+1] =int(grid[x][y])
#                 else:
#                     grid[x][y+1] +=int(grid[x][y])
#
# if grid[N-1][M-1] == '#' or grid[N-1][M-1]=='.':
#     print(0)
# else:
#     print(int(grid[N-1][M-1]))
#
# #
# N = int(stdin.readline())
# N1 = N*2
#
# likeset = set()
# notlikeset = set()
# everyone = list()
# everyonehate = list()
# for i in range(N):
#
#     like = stdin.readline().rstrip()
#     like1 = [l.strip() for l in like.split(',')]
#     notlike = stdin.readline().rstrip()
#     if notlike=='':
#         notlike="nothing"
#     notlike1 = [l.strip() for l in notlike.split(',')]
#    # print(like1,notlike1)
#
#     if like=='':
#         print("not lit")
#         exit()
#     for i in like1:
#         likeset.add(i)
#
#     everyone.append(like1)
#
#     for i in notlike1:
#         notlikeset.add(i)
#     everyonehate.append(notlike1)
#
#
#
# z = likeset.difference(notlikeset)
# # print(likeset)
# # print(notlikeset)
# #
# # print(everyonehate)
# #
# #
# # print(everyone)
# # print("zz",z)
# if len(z) !=0:
#     cnt = 0
#     for i in everyone:
#         for j in i:
#             if j in z:
#                 cnt+=1
#                 break
#         # if(cnt==0):
#         #     print("not lit")
#         #     exit()
#     if(cnt != len(everyone)):
#         print("not lit")
#         exit()
#     print("its lit")
# else:
#     print("not lit")


# weight = int(stdin.readline())
# items = int(stdin.readline())
# tup = list()
# for cases in range(items):
#     things = tuple(stdin.readline().split())
#     tup.append(things)
#
# sumx = 0
# for i in tup:
#     sumx+= int(i[1])
#
# if sumx <= weight:
#     print("my man!")
# else:
#     print("uh, Rick?")
