#include <bits/stdc++.h>
using namespace std;
int main() {
  char ca[110];
  scanf("%s", ca);
  int len = strlen(ca);
  int ans = 0;
  int flag = 0;
  for (int i = 0; i < len; i++) {
    if (ca[i] == 'V' && ca[i + 1] == 'K') {
      ans++;
      ca[i] = 'n';
      ca[i + 1] = 'n';
      i++;
    }
  }
  for (int i = 0; i < len; i++) {
    if (ca[i] == 'V' && ca[i + 1] == 'V' || ca[i] == 'K' && ca[i + 1] == 'K') {
      flag = 1;
      i++;
    }
  }
  cout << ans + flag << endl;
}
