#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[105];
  int a[105];
  while (~scanf("%s", s)) {
    memset(a, 0, sizeof a);
    int k = strlen(s);
    int ans = 0;
    for (int i = 0; i < k - 1; i++) {
      if (s[i] == 'V' && s[i + 1] == 'K') {
        a[i] = a[i + 1] = 1;
        ans++;
        i++;
      }
    }
    for (int i = 0; i < k - 1; i++) {
      if ((s[i] == 'V' || s[i + 1] == 'K') && a[i] == 0 && a[i + 1] == 0) {
        ans++;
        break;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
