#include <bits/stdc++.h>
using namespace std;
int compute(string a) {
  int solve = 0;
  int l = a.size();
  for (int i = 1; i < l; i++) {
    if (a[i - 1] == 'V' && a[i] == 'K') solve++;
  }
  return solve;
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  string a;
  cin >> a;
  int l = a.size();
  string b = a;
  int solve = 0;
  for (int i = 0; i < l; i++) {
    b[i] = 'V';
    solve = max(solve, compute(b));
    b[i] = 'K';
    solve = max(solve, compute(b));
    b[i] = a[i];
  }
  cout << solve << '\n';
}
