#include <bits/stdc++.h>
using namespace std;
char s[105];
int main() {
  int i, j, ans = 0;
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  for (i = 1; i <= len; i++) {
    if (s[i] == 'K' && s[i - 1] == 'V') ans++;
  }
  for (i = 1; i <= len; i++) {
    if (s[i] != 'V') {
      char c = s[i];
      s[i] = 'V';
      int now = 0;
      for (j = 1; j <= len; j++) {
        if (s[j] == 'K' && s[j - 1] == 'V') now++;
      }
      ans = max(now, ans);
      s[i] = c;
    }
    if (s[i] != 'K') {
      char c = s[i];
      s[i] = 'K';
      int now = 0;
      for (j = 1; j <= len; j++) {
        if (s[j] == 'K' && s[j - 1] == 'V') now++;
      }
      ans = max(now, ans);
      s[i] = c;
    }
  }
  cout << ans << endl;
  return 0;
}
