#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5;
const int MOD = 1e9 + 7;
char a[102];
int main() {
  int n, l, i, j, c = 0, ans = 0;
  scanf(" %s", a);
  l = strlen(a);
  for (i = 1; i < l; i++) {
    if (a[i - 1] == 'V' && a[i] == 'K') c++;
  }
  ans = max(c, ans);
  for (i = 0; i < l; i++) {
    c = 0;
    a[i] = ((a[i] == 'V') ? 'K' : 'V');
    for (j = 1; j < l; j++) {
      if (a[j - 1] == 'V' && a[j] == 'K') c++;
    }
    a[i] = ((a[i] == 'V') ? 'K' : 'V');
    ans = max(c, ans);
  }
  printf("%d\n", ans);
  return 0;
}
