#include <bits/stdc++.h>
using namespace std;
string in;
char chg(char a) {
  if (a == 'V') return 'K';
  return 'V';
}
int main() {
  cin >> in;
  int len = in.length();
  int tot = 0;
  for (int a = 0; a < len - 1; a++) {
    if (in[a] == 'V' && in[a + 1] == 'K') tot++;
  }
  for (int a = 0; a < len; a++) {
    in[a] = chg(in[a]);
    int as = 0;
    for (int b = 0; b < len - 1; b++)
      if (in[b] == 'V' && in[b + 1] == 'K') as++;
    tot = max(tot, as);
    in[a] = chg(in[a]);
  }
  cout << tot << endl;
}
