#include <bits/stdc++.h>
using namespace std;
int ans;
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'V' && s[i + 1] == 'K') {
      ans++;
      s[i] = ' ';
      s[i + 1] = ' ';
      i++;
    }
  }
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'V' && s[i + 1] == 'V' || s[i] == 'K' && s[i + 1] == 'K') {
      ans++;
      cout << ans;
      return 0;
    }
  }
  cout << ans;
  return 0;
}
