#include <bits/stdc++.h>
using namespace std;
int count(string s) {
  int c = 0;
  for (int i = 1; i < s.size(); ++i) {
    if (s[i] == 'K' && s[i - 1] == 'V') ++c;
  }
  return c;
}
int main() {
  string s;
  cin >> s;
  int c = count(s);
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == 'V') {
      s[i] = 'K';
      c = max(c, count(s));
      s[i] = 'V';
    } else {
      s[i] = 'V';
      c = max(c, count(s));
      s[i] = 'K';
    }
  }
  cout << c;
}
