#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int p, count = 0;
  while ((p = s.find("VK")) != -1) {
    s[p] = s[p + 1] = '*';
    count++;
  }
  if (s.find("VV") != -1 || s.find("KK") != -1) count++;
  cout << count;
  return 0;
}
