#include <bits/stdc++.h>
using namespace std;
int main() {
  char str[101];
  scanf("%s", str);
  int count = 0;
  for (int i = 0; i < strlen(str) - 1; i++) {
    if (str[i] == 'V' && str[i + 1] == 'K') {
      count++;
      str[i] = str[i + 1] = 'a';
    }
  }
  for (int i = 0; i < strlen(str) - 1; i++) {
    if (str[i] == 'V' && str[i + 1] == 'V') {
      count++;
      break;
    }
    if (str[i] == 'K' && str[i + 1] == 'K') {
      count++;
      break;
    }
  }
  printf("%i", count);
  return 0;
}
