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