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