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