#include <bits/stdc++.h>
int main() {
  char s[300];
  int flag = 0;
  int a[300];
  while (gets(s)) {
    int len;
    int sum = 0;
    len = strlen(s);
    for (int i = 0; i < len; i++) {
      if (s[i] == 'V' && s[i + 1] == 'K') {
        sum++;
        i++;
        a[i] = a[i + 1] = 1;
      } else if (s[i] == 'V') {
        a[i] = 2;
      } else if (s[i] == 'K') {
        a[i] = 3;
      }
    }
    for (int i = 0; i < len; i++) {
      if (a[i] == a[i + 1] && a[i] != 1) flag = 1;
    }
    printf("%d\n", flag + sum);
  }
  return 0;
}
