#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const int MAX = (int)1e5 + 5;
int main(void) {
  string s;
  cin >> s;
  int l = s.length();
  bitset<105> check;
  int res = 0;
  for (int i = 0; i < (s.length() - 1); ++i) {
    if (s[i] == 'V' && s[i + 1] == 'K') {
      res++;
      check[i] = check[i + 1] = 1;
    }
  }
  for (int i = 0; i < (l - 1); ++i) {
    if (check[i]) continue;
    if (s[i] == 'V' && !check[i + 1] && s[i + 1] == 'V') {
      res++;
      break;
    }
    if (s[i] == 'K' && !check[i + 1] && s[i + 1] == 'K') {
      res++;
      break;
    }
  }
  cout << res << endl;
  return 0;
}
