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