#include <bits/stdc++.h>
using namespace std;
int main() {
  bool jud = false;
  int ans = 0;
  string s;
  cin >> s;
  int len = s.size();
  s[len] = 'D';
  for (int i = 0; i <= len - 2; i++) {
    if (s[i] == 'V' && s[i + 1] == 'K') ans++;
    if (s[i] == 'V' && s[i + 1] == 'V' && s[i + 2] != 'K') jud = true;
    if (s[i - 1] != 'V' && s[i] == 'K' && s[i + 1] == 'K') jud = true;
  }
  if (jud) ans++;
  cout << ans << endl;
}
