#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int x = 0, y = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'V' && s[i + 1] == 'K') {
      x++;
      i++;
    } else if (s[i] == 'K' && s[i + 1] == 'K') {
      y++;
    } else if (s[i] == 'V' && s[i + 1] == 'V' && s[i + 2] != 'K') {
      y++;
    }
  }
  if (y > 0)
    cout << x + 1 << endl;
  else
    cout << x << endl;
}
