#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  int ans = 0;
  bool b = false;
  bool op = false;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == 'V' && s[i + 1] == 'K') {
      ans++;
      i++;
      op = false;
      continue;
    }
    if (op == true) b = true;
    if (s[i] == s[i + 1]) {
      op = true;
    }
  }
  if (op == true) b = true;
  if (b) ans++;
  cout << ans;
  return 0;
}
