#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  cin >> s;
  int t = s.length();
  for (int i = 0; i < s.length(); i++) {
    if (s[0] == 'K' && s[1] == 'K') {
      s[0] = 'V';
      break;
    }
    if (s[t - 1] == 'V' && s[t - 2] == 'V') {
      s[t - 1] == 'K';
    }
    if (s[i] == 'V') {
      if (s[i + 1] == 'V' && s[i + 2] != 'K') {
        s[i + 1] = 'K';
        break;
      }
    } else if (s[i] == 'K') {
      if (s[i + 1] == 'K' && s[i + 2] == 'K') {
        s[i + 1] = 'V';
        break;
      }
    }
  }
  int count = 0;
  size_t npos = s.find("VK", 0);
  while (npos != string::npos) {
    count++;
    npos = s.find("VK", npos + 1);
  }
  cout << count << endl;
  return 0;
}
