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