#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  char set[101] = {0};
  int num, i;
  while (cin >> s) {
    if (s.size() <= 1) {
      cout << "0" << endl;
    } else {
      num = 0;
      for (i = 0; i < s.size(); i++) {
        if (s[i] == 'V' && s[i + 1] == 'K') {
          set[i] = set[i + 1] = 1;
          num++;
          i++;
        } else if (s[i] == 'V') {
          set[i] = 2;
        } else if (s[i] == 'K') {
          set[i] = 3;
        }
      }
      for (i = 0; i < s.size(); i++) {
        if (set[i] == set[i + 1] && set[i] != 1) {
          num++;
          break;
        }
      }
      cout << num << endl;
      for (i = 0; i < s.size(); i++) {
        set[i] = 0;
      }
    }
  }
  return 0;
}
