#include <bits/stdc++.h>
const int MaxN = 100;
using namespace std;
char s[MaxN + 5];
int vis[MaxN + 5], n;
int main() {
  while (~scanf("%s", s + 1)) {
    int len = strlen(s + 1);
    memset(vis, 0, sizeof(vis));
    int ans = 0;
    for (int i = 1; i <= len; i++) {
      if (s[i] == 'V' && s[i + 1] == 'K') {
        ans++;
        vis[i] = vis[i + 1] = 1;
        i++;
      }
    }
    int cnt = 0, Max = 0, cnt1 = 0;
    for (int i = 1; i <= len; i++) {
      if (s[i] == 'K') {
        cnt++;
        if (vis[i]) cnt = 0;
      } else
        cnt = 0;
      if (s[i] == 'V') {
        cnt1++;
        if (vis[i]) cnt1 = 0;
      } else
        cnt1 = 0;
      Max = max(Max, max(cnt, cnt1));
    }
    if (Max >= 2) ans++;
    printf("%d\n", ans);
  }
}
