#include <bits/stdc++.h>
using namespace std;
int main() {
  char x[150];
  char y[150];
  int i = 0, j = 0, c = 0, z = 0, l = 0;
  cin >> x;
  while (x[j] != '\0') {
    if (x[j] == 'V' && x[j + 1] == 'K') {
      c++;
    }
    j++;
  }
  for (j = 0; j < 150; j++) {
    y[j] = x[j];
  }
  while (y[i] != '\0') {
    j = 0;
    if (y[i] == 'V') {
      y[i] = 'K';
    } else {
      y[i] = 'V';
    }
    while (y[j] != '\0') {
      if (y[j] == 'V' && y[j + 1] == 'K') {
        z++;
      }
      j++;
    }
    for (j = 0; j < 150; j++) {
      y[j] = x[j];
    }
    if (z > c) c = z;
    i++;
    z = 0;
  }
  cout << c;
  return 0;
}
