#include <bits/stdc++.h>
int main() {
  char str[100];
  int i, j, len, r, K;
  while (scanf("%s", str) != EOF) {
    r = 0;
    K = 0;
    len = strlen(str);
    for (i = 0; i < len; i++) {
      if (str[i] == 'V' && str[i + 1] == 'K') {
        r = r + 1;
        str[i] = '0';
        str[i + 1] = '0';
      }
    }
    for (i = 0; i < len - 1; i++)
      if ((str[i] == 'V' && str[i + 1] == 'V') ||
          (str[i] == 'K' && str[i + 1] == 'K'))
        K = 1;
    printf("%d\n", r + K);
  }
  return 0;
}
