#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  string s, w = "";
  cin >> s;
  int n = 0;
  bool b = 1;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'V') {
      if (s[i + 1] == 'K') {
        n++;
        b = 0;
      }
    }
    if (b) {
      w += s[i];
    } else {
      w += 'O';
      i++;
      b = 1;
    }
  }
  b = 0;
  for (int i = 0; i < w.length() - 1; i++) {
    if (w[i] == w[i + 1] && w[i] != 'O') {
      b = 1;
    }
  }
  if (b) {
    n++;
  }
  cout << n << endl;
  return 0;
}
