#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int k = 0;
  string s2 = s;
  for (long long int i = 0; i < s2.size() - 1; i++) {
    if (s2[i] == 'V' && s2[i + 1] == 'K') {
      k++;
    }
  }
  long long int ma = k;
  for (long int i = 0; i < s.size(); i++) {
    k = 0;
    if (s[i] == 'V')
      s[i] = 'K';
    else
      s[i] = 'V';
    for (long long int i = 0; i < s.size() - 1; i++) {
      if (s[i] == 'V' && s[i + 1] == 'K') {
        k++;
      }
    }
    if (ma < k) ma = k;
    s = s2;
  }
  cout << ma << endl;
}
