#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  char pr;
  cin >> s;
  pr = s[0];
  int ans = 0;
  for (int(i) = 0; (i) < (s.length()); ++(i)) {
    string str = s;
    (str[i] == 'V') ? (str[i] = 'K') : (str[i] = 'V');
    pr = str[0];
    int cnt = 0;
    for (int j = 1; j < str.length(); j++) {
      if (pr == 'V' && str[j] == 'K') cnt++;
      pr = str[j];
    }
    if (cnt > ans) ans = cnt;
  }
  pr = s[0];
  int cnt = 0;
  for (int(i) = 0; (i) < (s.length()); ++(i)) {
    if (pr == 'V' && s[i] == 'K') cnt++;
    pr = s[i];
  }
  if (cnt > ans) ans = cnt;
  cout << ans << endl;
  return 0;
}
