#include <bits/stdc++.h>
using namespace std;
int main() {
  char ch[120], ch2[120];
  int i, sum = 0, j, length, k = 0, sum2 = 0;
  scanf("%s", ch);
  int len = strlen(ch);
  i = 0;
  if (len <= 1)
    printf("0\n");
  else {
    i = 0;
    while (i < len - 1) {
      if (ch[i] == 'V' && ch[i + 1] == 'K') {
        ch[i] = '0';
        ch[i + 1] = '0';
        sum = sum + 1;
      }
      i++;
    }
    i = 0;
    while (i < len - 1) {
      if ((ch[i] == 'V' && ch[i] != '0' && ch[i + 1] != '0') ||
          (ch[i] == 'K' && ch[i + 1] == 'K' && ch[i] != '0' &&
           ch[i + 1] != '0')) {
        sum2 = 1;
        break;
      }
      i++;
    }
    printf("%d\n", sum + sum2);
  }
  return 0;
}
