#include <bits/stdc++.h>
using namespace std;
int count(string s) {
  int ans = 0;
  int n = s.length();
  for (int i = 0; i < n - 1; i++)
    if (s[i] == 'V' && s[i + 1] == 'K') ans++;
  return ans;
}
int main() {
  string s;
  cin >> s;
  int ans = count(s);
  int n = s.length();
  for (__typeof(n) i = 0 - (0 > n); i != n - (0 > n); i += 1 - 2 * (0 > n)) {
    string temp = s;
    if (s[i] == 'V')
      temp[i] = 'K';
    else
      temp[i] = 'V';
    ans = max(ans, count(temp));
  }
  cout << ans << "\n";
  return 0;
}
