#include <bits/stdc++.h>
using namespace std;
int main() {
  char str[103];
  int len, sum = 0, flag = 1;
  scanf("%s", str);
  len = strlen(str);
  if (len == 1)
    printf("%d", 0);
  else {
    for (int i = 0; i < len - 1; i++)
      if (str[i] == 'V')
        if (str[i + 1] == 'K') sum++;
    for (int j = 0; j < len; j++) {
      int temp = 0;
      if (str[j] == 'V')
        str[j] = 'K';
      else
        str[j] = 'V';
      for (int i = 0; i < len - 1; i++)
        if (str[i] == 'V')
          if (str[i + 1] == 'K') temp++;
      if (str[j] == 'V')
        str[j] = 'K';
      else
        str[j] = 'V';
      if (temp > sum) sum = temp;
    }
    printf("%d", sum);
  }
  return 0;
}
