#include <bits/stdc++.h>
using namespace std;
int ctr(string s) {
  int c = 0;
  for (int i = 1; i < s.length(); i++) {
    if (s[i - 1] == 'V' && s[i] == 'K') c++;
  }
  return c;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int c = ctr(s);
  for (int i = 0; i < (s.length()); i++) {
    if (s[i] == 'V') {
      s[i] = 'K';
      c = max(c, ctr(s));
      s[i] = 'V';
    } else {
      s[i] = 'V';
      c = max(c, ctr(s));
      s[i] = 'K';
    }
  }
  cout << c << "\n";
  return 0;
}
