#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    string s;
    cin >> s;
    int ans = 0;
    for (long long int i = 0; i < (long long int)s.size() - 1; i++) {
      if (s[i] == 'V' && s[i + 1] == 'K') ans++;
    }
    for (long long int i = 0; i < (long long int)s.size(); i++) {
      string t = s;
      if (t[i] == 'V')
        t[i] = 'K';
      else
        t[i] = 'V';
      int ct = 0;
      for (long long int i = 0; i < (long long int)s.size() - 1; i++) {
        if (t[i] == 'V' && t[i + 1] == 'K') ct++;
      }
      ans = max(ans, ct);
    }
    cout << ans;
  }
  return 0;
}
