#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
int main() {
  string s, s1;
  cin >> s1;
  int n = s1.length(), ans = 0, res = 0;
  for (int i = 0; i + 1 < n; ++i) res += s1[i] == 'V' && s1[i + 1] == 'K';
  for (int k = 0; k < n; ++k) {
    s = s1;
    if (s[k] == 'V')
      s[k] = 'K';
    else
      s[k] = 'V';
    ans = 0;
    for (int i = 0; i + 1 < n; ++i) ans += s[i] == 'V' && s[i + 1] == 'K';
    res = max(res, ans);
  }
  cout << res << endl;
  return 0;
}
