#include <bits/stdc++.h>
using namespace std;
const int MAX_LEN = 100;
int len;
char str[MAX_LEN + 1];
int nbOccs() {
  int nbOccs = 0;
  for (int i = 0; i < len; i++) nbOccs += str[i] == 'V' && str[i + 1] == 'K';
  return nbOccs;
}
int main() {
  scanf("%s", str);
  len = strlen(str);
  int maxOccs = 0;
  for (int i = 0; i < len; i++) {
    char c = str[i];
    str[i] = 'V';
    maxOccs = max(maxOccs, nbOccs());
    str[i] = 'K';
    maxOccs = max(maxOccs, nbOccs());
    str[i] = c;
  }
  printf("%d", maxOccs);
}
