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