#include <iostream>
#include<string>
using namespace std;
int main()
{
int n, a, b, c,w=0,s=0;
string dt;
cin >> n>>dt;
b = dt.find("VV");
c = dt.find("KK");
if ((b >= 0 && b <= dt.size()) || (c >= 0 && c <= dt.size()))
w = 1;
while (dt.find("VK")>=0&& dt.find("VK")<=dt.size()){
a = dt.find("VK");
if (a + 2 >= 0 && a + 2 <= dt.size()) {
dt = dt.substr(a + 2, dt.size());
s++;
}
}
cout << s + w;
}