#include <bits/stdc++.h>
using namespace std;
string s;
inline int sum() {
  int i, re = 0;
  for (i = 0; i < s.size() - 1; i++) {
    if (s.substr(i, 2) == "VK") re++;
  }
  return re;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> s;
  int i, mx = -135;
  mx = max(mx, sum());
  for (i = 0; i < s.size(); i++) {
    if (s[i] == 'V') {
      s[i] = 'K';
      mx = max(mx, sum());
      s[i] = 'V';
    } else {
      s[i] = 'V';
      mx = max(mx, sum());
      s[i] = 'K';
    }
  }
  cout << mx << endl;
  return 0;
}
