#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
string s;
int main() {
  cin >> s;
  int i = 0, cnt = 0;
  int len = s.size();
  while ((i = s.find("VK")) != -1) {
    s[i] = s[i + 1] = '.';
    cnt++;
  }
  if (s.find("VV") != -1 || s.find("KK") != -1) cnt++;
  printf("%d\n", cnt);
  return 0;
}
