n=int(input())
m=input()
x=m.count("VK")
a=m.count("VVK")
b=m.count("VKK")
if m.count("VV")>0:
if a>=m.count("VV"):
if m.count("KK")>0:
if b>=m.count("KK"):
print(x)
else:
print(x+1)
else:
print(x)
else:print(x+1)
else:
if m.count("KK")>0:
if b>=m.count("KK"):
print(x)
else:
print(x+1)
else:
print(x)