#include <bits/stdc++.h>
using namespace std;
long long int c[200];
bool b[100000][2];
int main() {
  string s;
  cin >> s;
  int cnt = 0;
  int max = 0;
  for (int j = 0; j < s.length() - 1; j++)
    if (s.substr(j, 2) == "VK") cnt++;
  max = cnt;
  for (int i = 0; i < s.length(); i++) {
    cnt = 0;
    if (s[i] == 'V')
      s[i] = 'K';
    else
      s[i] = 'V';
    for (int j = 0; j < s.length() - 1; j++)
      if (s.substr(j, 2) == "VK") {
        cnt++;
      }
    if (cnt > max) max = cnt;
    if (s[i] == 'V')
      s[i] = 'K';
    else
      s[i] = 'V';
  }
  cout << max;
  return 0;
}
